Hi im new to the forum and relatively new to using Dude as well. I have read the probe thread but im needing something specific to cover us with a variety of different server setups.
I want to create a custom script which from the smtp.conf file says is possible and I am indeed getting the response Im looking for when running the snmpwalk command :
snmpwalk -v 3 -u snmp_user -a md5 -A XXXXXX -l AuthPriv -x DES -X XXXXXX 1.1.1.1 UCD-SNMP-MIB::extResult.1
UCD-SNMP-MIB::extResult.1 = INTEGER: 35
I have put the script in the /etc/snmp/snmpd.conf :
exec snmp_diskspace /bin/bash /usr/local/bin/snmp_diskspace.bash
And as I say I can run the snmpwalk command manually fine and get the expected result so I dont think Im facing an smtp issue.
My issue is getting Dude to pick up the value and ascertain if the service is available or not. Firstly the script is just a basic disk space check looking for percentage used. However I didnt want to use the predefined OIDs as im running on a network with 150+ servers and the mount points (therefore ids) are different across each server.
Therefore to keep things very simple my script checks ALL filesystems (just a simple df -k) and reports the highest space used which I then want to use as the trigger.
My function in dude states this :
oid(“UCD-SNMP-MIB::extResult.1”)
Which if I run it manually from the Dude server it replies perfectly with the percentage im after.
The probe ive set it to use says :
Agent : Default
Available : highest_diskspace() < 80
Error : if (highest_diskspace() > 80, “”, “down”)
Value : highest_diskspace()
Unit : %
I have set up the service in one of the servers im testing this with which all works fine manually, but if I click reprobe or wait for its polling interval it always says ‘down’
I think thats all the config I have set up but if I missed something important let me know and I will reply to this post.
The only things im a bit uncertain on are :
- the probe available/error syntax
- From the oid im using (oid(“UCD-SNMP-MIB::extResult.1”) should I be using the exit code/result, or simply make the script echo the value and exit with a 0
Look forward to hearing from someone with some skills in this !!!
Thanks
UPDATE :
Just to add as it seems that its Dude not recognising the snmp poll as i can run it manually from the server fine, I have just checked and added the specific MIB file (UCD-SNMP-MIB) into Dude. However it hasnt fixed my issue.
Any help appreciated !!