I am trying to monitor HAProxy states through SNMP. There is a haproxy.pl file for use with NetSNMP which I've copied and set up in snmpd.conf according to
/usr/share/doc/haproxy/contrib/netsnmp-perl/README.gz. Two lines have been appended to snmpd.conf:
disablePerl false perl do '/etc/snmp/haproxy.pl';
which should have done the trick, but querying the appropriate OID just gives:
denis@nagios:~# snmpbulkwalk -c public -v2c 192.168.1.102 126.96.36.199.4.1.29385.106 SNMPv2-SMI::enterprises.29385.106 = No Such Object available on this agent at this OID
I've done a research on the net and there seems to be some fuzz about Ubuntu's net-snmp not having been compiled with the --enable-embedded-perl option. I've checked that with
net-snmp-config --configure-options and there were no embedded-perl options mentioned, which would mean that it defaulted to enabling embedded perl support according to the INSTALL docs. Furthermore, I was getting the error
embedded perl support failed to initalize (apparently meaning that I was missing a prerequisite module) until I've installed libsnmp-dev - another clue that embedded perl support was compiled in.
Net-SNMP now restarts quite fine and without errors, but yet I have no luck in querying the HAProxy OID. My logs just show entries like
Connection from UDP: [192.168.1.111]:34391->[192.168.1.102]
Any ideas greatly appreciated. Furthermore, if someone has got some perl-agent setup running with Ubuntu, I'd love to hear the configuration details.