Haproxy's supervision

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
Erwan
Posts: 4
Joined: Fri Jun 01, 2018 2:42 am

Haproxy's supervision

Post by Erwan »

Hello,

I'm trying to check a Haproxy's server with my cacti but I've got a "This data query returned 0 rows" message in my cacti.
After some checks, it appear that my snmp don't find OID even on my Haproxy's server.
My command :
snmpwalk -c snmpcommunity -v 2c 127.0.0.1 1.3.6.1.4.1.29385.106.1.0.17

And the return is :
SNMPv2-SMI::enterprises.29385.106.1.0.17 = No Such Instance currently exists at this OID
Haproxy version : 1.7.5-2

I've extract from haproxy's package the netsnmp dir with perl script and xml files, and follow the readme.
You could find the same here :
https://github.com/haproxy/haproxy/tree ... tsnmp-perl

I've just modified my haproxy.pl because we use /run/haproxy/admin.sock instead of /var/run/haproxy.stat for stats (conf in /etc/haproxy/haproxy.cfg)
I've tried with /var/run/haproxy.stat on another server and we got same error.

My others snmp's check are OK on this server (load, memory, disks...)

Someone had already solved this problem and could help me ?
Thanks.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Haproxy's supervision

Post by netniV »

Do you have netsnmp installed and working? If you just do an SNMPWALK of the device, does it return what you expect?
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Erwan
Posts: 4
Joined: Fri Jun 01, 2018 2:42 am

Re: Haproxy's supervision

Post by Erwan »

I already do my snmpwalk on the device to avoid network's snmp issues.

I can't find "netsnmp" on the repo, snmp's packages installed on device are :

Code: Select all

dpkg -l | grep snmp
ii  libnet-snmp-perl               6.0.1-2                        all          Script SNMP connections
ii  libsnmp-base                   5.7.3+dfsg-1.7                 all          SNMP configuration script, MIBs and documentation
ii  libsnmp-perl                   5.7.3+dfsg-1.7                 amd64        SNMP (Simple Network Management Protocol) Perl5 support
ii  libsnmp30:amd64                5.7.3+dfsg-1.7                 amd64        SNMP (Simple Network Management Protocol) library
ii  snmp                           5.7.3+dfsg-1.7                 amd64        SNMP (Simple Network Management Protocol) applications
ii  snmp-mibs-downloader           1.1+nmu1                       all          Install and manage Management Information Base (MIB) files
ii  snmpd                          5.7.3+dfsg-1.7                 amd64        SNMP (Simple Network Management Protocol) agents
I had to install libnet-snmp-perl in order to fix this error :
~# perl /etc/snmp/haproxy.pl
Can't locate NetSNMP/agent.pm in @INC (you may need to install the NetSNMP::agent module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.20.2 /usr/local/share/perl/5.20.2 /usr/lib/x86_64-linux-gnu/perl5/5.20 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.20 /usr/share/perl/5.20 /usr/local/lib/site_perl .) at /etc/snmp/haproxy.pl line 18.
BEGIN failed--compilation aborted at /etc/snmp/haproxy.pl line 18
If I do perl /etc/snmp/haproxy.pl, I get no output.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Haproxy's supervision

Post by netniV »

What OS is this on?
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Erwan
Posts: 4
Joined: Fri Jun 01, 2018 2:42 am

Re: Haproxy's supervision

Post by Erwan »

Debian 9.4
Erwan
Posts: 4
Joined: Fri Jun 01, 2018 2:42 am

Re: Haproxy's supervision

Post by Erwan »

Problem solved.

I had to do some things for that :
  • Add my snmp's service user in haproxy's group. This allow it to read the stats socket.
  • Add in my snmpd.conf this line : pass .1.3.6.1.4.1.29385 /usr/bin/perl /etc/snmp/haproxy.pl
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest