custom SNMP for custom graph
Manao ahoana, Hello, Bonjour,
I have an already working MRTG+SNMP+Apache here:
http://srv3.rktmb.org:90/mrtg/
I try to make a custom MRTG graph
First, I need to build SNMP stuff.
Say I want to monitor the access of my web server by counting the
number of lines of my access_log file. Just that simple, to begin.
I have a script:
/usr/local/bin/ocsigen_access containing:
#!/bin/bash
echo "ocsigen"
echo $(wc -l /var/log/ocsigen/access.log | awk '{print $1}')
exit 35
Then in my /etc/snmp/snmpd.conf, I added:
exec .1.3.6.1.4.1.2021.254 ocsigen /usr/local/bin/ocsigen_access
Then restart SNMPd
invoke-rc.d snmpd restart
Then on the same host:
snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.254
(returns nothing...)
What did I miss?
PS:
$ echo $(wc -l /var/log/ocsigen/access.log | awk '{print $1}')
510502
$
Misaotra, Thanks, Merci.
--
Architecte Informatique chez Blueline/Gulfsat:
Administration Systeme, Recherche & Developpement
+261 34 29 155 34 / +261 33 11 207 36
Reply to: