Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to monitor HAProxy states through SNMP. There is a 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/';

which should have done the trick, but querying the appropriate OID just gives:

denis@nagios:~# snmpbulkwalk -c public -v2c
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: []:34391->[]

Any ideas greatly appreciated. Furthermore, if someone has got some perl-agent setup running with Ubuntu, I'd love to hear the configuration details.

share|improve this question
In /tmp/, try putting system("touch /tmp/"); return 1;. If you start snmpd and it creates /tmp/ then you know the perl is getting executed. Otherwise, there is a different problem. Also make sure that your snmpd.conf file is being read (run snmpd using: -f -Le -Dread_config and watch the output). – Wes Hardaker May 25 '11 at 22:05
up vote 1 down vote accepted

make sure your haproxy stats already enabled

     stats socket /var/run/haproxy.stat mode 666

and then try to execute /etc/snmp/

 perl /etc/snmp/

it's should be showing the output if the steps above running well, and when you snmpwalk still no output, check your snmp installation again. or just run below command to check your standard snmp working fine.


above command should be showing stats like cpu, ip addr, etc and snmp installation and config should be fine. and it's mean something not right on snmp perl for haproxy.

share|improve this answer
Thank you - the "stats" socket was missing so had no results to forward. – the-wabbit May 26 '11 at 7:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.