Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Tue Jun 18, 2019 12:26 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Haproxy's supervision
PostPosted: Fri Jun 01, 2018 3:05 am 
Offline

Joined: Fri Jun 01, 2018 2:42 am
Posts: 4
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 :
Quote:
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/master/contrib/netsnmp-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.


Top
 Profile  
 
 Post subject: Re: Haproxy's supervision
PostPosted: Fri Jun 01, 2018 5:42 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2499
Do you have netsnmp installed and working? If you just do an SNMPWALK of the device, does it return what you expect?

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: Haproxy's supervision
PostPosted: Mon Jun 04, 2018 4:06 am 
Offline

Joined: Fri Jun 01, 2018 2:42 am
Posts: 4
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:
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 :
Quote:
~# 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.


Top
 Profile  
 
 Post subject: Re: Haproxy's supervision
PostPosted: Mon Jun 04, 2018 5:52 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2499
What OS is this on?

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: Haproxy's supervision
PostPosted: Mon Jun 04, 2018 8:20 am 
Offline

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


Top
 Profile  
 
 Post subject: Re: Haproxy's supervision
PostPosted: Fri Jun 08, 2018 3:07 am 
Offline

Joined: Fri Jun 01, 2018 2:42 am
Posts: 4
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: Bing [Bot] and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group