I've built my own module that is a clone of the UC Davis Process module. I posted sometime back that I needed to use regular expressions to find processes. I built my module and it does list running processes, but I cannot get the module to restart the processes once it's detected it's stopped.
Here's a working copy using the regular UCDavis MIB that does work WORKING =========================== ... createUser _internal rwuser _internal iquerySecName _internal proc mongod procfix mongod /etc/init.d/mongod start proc sendmail procfix sendmail /etc/init.d/sendmail start setEvent prFixIt prErrFix = 1 monitor -r 10 -e prFixIt "procTable" prErrorFlag != 0 Here's mine that doesn't work NOT WORKING ========================= ... createUser _internal rwuser _internal iquerySecName _internal dlmod regexp_proc /opt/sipx-main/lib/snmpagent/regexp_proc.so regexp_proc mongod 0 1 .*/mongod.*-f.*/mongod.conf regexp_procfix mongod /etc/init.d/mongod start regexp_proc sendmail regexp_procfix sendmail /etc/init.d/sendmail start setEvent prFixIt 1.3.6.1.4.1.7142.100.1.10.102 = 1 monitor -r 10 -e prFixIt "procTable" 1.3.6.1.4.1.7142.100.1.10.100 != 0 Here's a printout of walking my module ======================================= SNMPv2-SMI::enterprises.7142.100.1.10.1.1 = INTEGER: 1 SNMPv2-SMI::enterprises.7142.100.1.10.1.2 = INTEGER: 2 SNMPv2-SMI::enterprises.7142.100.1.10.2.1 = STRING: "mongod" SNMPv2-SMI::enterprises.7142.100.1.10.2.2 = STRING: "sendmail" SNMPv2-SMI::enterprises.7142.100.1.10.3.1 = INTEGER: 1 SNMPv2-SMI::enterprises.7142.100.1.10.3.2 = INTEGER: 1 SNMPv2-SMI::enterprises.7142.100.1.10.4.1 = INTEGER: 0 SNMPv2-SMI::enterprises.7142.100.1.10.4.2 = INTEGER: 0 SNMPv2-SMI::enterprises.7142.100.1.10.5.1 = INTEGER: 0 SNMPv2-SMI::enterprises.7142.100.1.10.5.2 = INTEGER: 4 SNMPv2-SMI::enterprises.7142.100.1.10.100.1 = INTEGER: 1 SNMPv2-SMI::enterprises.7142.100.1.10.100.2 = INTEGER: 0 SNMPv2-SMI::enterprises.7142.100.1.10.101.1 = STRING: "No mongod process running" SNMPv2-SMI::enterprises.7142.100.1.10.101.2 = "" SNMPv2-SMI::enterprises.7142.100.1.10.102.1 = INTEGER: 0 SNMPv2-SMI::enterprises.7142.100.1.10.102.2 = INTEGER: 0 SNMPv2-SMI::enterprises.7142.100.1.10.103.1 = STRING: "/etc/init.d/mongod start" SNMPv2-SMI::enterprises.7142.100.1.10.103.2 = STRING: "/etc/init.d/sendmail start" Here's interesting part of stdout that shows me prFixIt event is firing ================================================= ... disman:event:trigger:fire: Firing boolean test: SNMPv2-SMI::enterprises.7142.100.1.10.100.1 (startup) trace: mteEvent_fire(): disman/event/mteEvent.c, 249: disman:event:fire: Event fired (snmpd.conf, prFixIt) trace: build_oid_noalloc(): mib.c, 3762: ... I've got a suspicion that prFixIt cannot be used outside the UC Davis Process module, but I'm not sure. Any help would be appreciated. I'm using net-snmp-libs-5.7.1 that comes w/Fedora 14 ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Net-snmp-users mailing list [email protected] Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
