hello,
I was able to fix the problem by modifying the snmpmon script a bit.
Allan P. Magmanlac wrote:
Hello,
I'm setting up snips1.1 monitoring of a redhat system to monitor
processes that are running. The intention is to monitor the number of
services running and if the number is below the certain threshold, it
will generate an alarm. Below are the details, quite lenghty but I'm
trying to make clear as much as I can.
1) From snmpmon-collector, in the init_system function, I made slight
modification to the
a) "prefix" variable and set it to "$MIBENTERPRISE".
$MIBENTERPRISE = ".iso.org.dod.internet.private.enterprises"
b) in lvars, I specified what I would like to monitor. These
items correspond to what I have setup in my server I would like to
query. (i.e ucdavis.prTable.prEntry.prCount.1 corresponds to
sshd daemon.
my @lvars = qw( ucdavis.prTable.prEntry.prCount.1
ucdavis.prTable.prEntry.prCount.2 ucdavis.prTable.prEntry.prCount.3
ucdavis.prTable.prEntry.prCount.4 ucdavis.prTable.prEntry.prCount.5
ucdavis.prTable.prEntry.prCount.6 ucdavis.prTable.prEntry.prCount.7
ucdavis.prTable.prEntry.prCount.8);
c) I'm using snmpget to get the value, so for instance to query the
number of ssh running, the script uses the line below and return 1.
when snmp-collector is run I turned debugging and it works fine.
(example below)
COMMAND /usr/local/snips/bin/snmpget test.domain.ca mypass
.iso.org.dod.internet.private.enterprises.ucdavis.prTable.prEntry.prCount.1
Stored
nvarval{.iso.org.dod.internet.private.enterprises.ucdavis.prTable.prEntry.prCount.1}
= 1
2) From my snmpmon-confg, i have the related info.
#sshd
prCount.1 test.domain.ca 0 0 0
#osirisd
prCount.2 test.domain.ca 3 2 2
#cvsupd
prCount.3 test.domain.ca 0 0 0
#named
prCount.4 test.domain.ca 0 0 0
#syslogd
prCount.5 test.domain.ca 0 0 0
#snmpd
prCount.6 test.domain.ca 0 0 0
#amavisd
prCount.7 test.domain.ca 30 20 10
#clamd
prCount.8 test.domain.ca 0 0 0
3) When I run, snmpmon master server, not modified the script. It
seems fine.
(dbg) thresindex{prCount.4} = 5
(dbg) thresindex{prCount.2} = 3
(dbg) thresindex{prCount.5} = 6
(dbg) thresindex{prCount.1} = 2
(dbg) thresindex{prCount.6} = 7
(dbg) thresindex{prCount.8} = 9
(dbg) thresindex{prCount.7} = 8
(dbg) thresindex{prCount.3} = 4
(dbg) Total variables in config= 8
(dbg) Configured thresholds are:
thress[0] = prCount.1 test.domain.ca 0 0 0
thress[1] = prCount.2 test.domain.ca 3 2 2
thress[2] = prCount.3 test.domain.ca 0 0 0
thress[3] = prCount.4 test.domain.ca 0 0 0
thress[4] = prCount.5 test.domain.ca 0 0 0
thress[5] = prCount.6 test.domain.ca 0 0 0
thress[6] = prCount.7 test.domain.ca 30 20 10
thress[7] = prCount.8 test.domain.ca 0 0 0
Doing datafile /tmp/snmpmon_data/test.domain.ca.snmpmon
4)the snmpmon info
#cat /tmp/snmp*/test.domain.ca.snmpmon
TIME 1149261973 Fri Jun 2 11:26:13 2006
DEVICE test.domain.ca
VARIABLE prCount.1 1
VARIABLE prCount.2 4
VARIABLE prCount.3 0
VARIABLE prCount.4 1
VARIABLE prCount.5 1
VARIABLE prCount.6 1
VARIABLE prCount.7 25
VARIABLE prCount.8 1
5) But when I view the snmpmon output, I do not see anything except
the following.
/usr/local/snips/bin/display_snips_datafile snmpmon-output
::::: snmpmon-output ::::
Fri Jun 2 11:23:21 2006 [snmpmon]: DEVICE test.domain.ca
test.domain.ca VAR DataAge 128 900 Secs LEVEL Info LOGLEVEL Info STATE up
Thanks.
--
Allan P. Magmanlac
allan magmanlac at nrns.ca
NRNS Incorporated
DREnet Network Coordination Centre (NCC)
Tel: (613) 599-7860 ext 107
|