I almost got this working but I return a string so it wont graph.
There is probably a better way to do this but this seems pretty cool but I can't quite get it to work. I am trying to get the number of failed ssh attempts by grepping /var/log/messages and I got it with the script method but it is ugly. I came up with this method but it wont graph becuase I return a string not a number. Can anyone tell me how I can force an integer from as a return value.
snmpd.conf:
exec .1.3.6.1.4.1.2021.50 sshcount /bin/sh /usr/local/bin/sshcount
/usr/local/bin/sshcount:
/bin/grep password /var/log/messages | wc -l
snmpwalk output:
UCD-SNMP-MIB::ucdavis.50.1.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.50.2.1 = STRING: "sshcount"
UCD-SNMP-MIB::ucdavis.50.3.1 = STRING: "/bin/sh /usr/local/bin/sshcount"
UCD-SNMP-MIB::ucdavis.50.100.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.50.101.1 = STRING: " 5340"
UCD-SNMP-MIB::ucdavis.50.102.1 = INTEGER: 0
I try to graph 1.3.6.1.4.1.2021.50.101.1
and get nan becuase (I am assuming) a string is returned and not a number
Thanks
Kyle Bowerman ( k y l e a t b o w e r m a n d o t o r g)
getting ssh failed attempts via ucd::mib Arbitrary Extension
Moderators: Developers, Moderators
Who is online
Users browsing this forum: No registered users and 1 guest