[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: custom SNMP for custom graph

I think you want to use sh instead of exec. Quoting from the man page:
"The PROG argument for exec directives must be a full path to a real
binary, as it is executed via the exec() system  call.   To  invoke  a
shell script, use the sh directive instead."

Also, I'd double check to make sure the script has the proper
permissions set so that it is executable by the snmpd daemon.

If all fails, I'd grep /var/log for snmpd and see what sort of errors
you get. They're usually quite helpful.



-----Original Message-----
From: Mihamina Rakotomandimby [mailto:mihamina@gulfsat.mg] 
Sent: March 9, 2010 9:26 AM
To: List Debian User; net-snmp-coders@lists.sourceforge.net
Subject: custom SNMP for custom graph

Manao ahoana, Hello, Bonjour,

I have an already working MRTG+SNMP+Apache here:

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:

 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 . 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 .  (returns

What did I miss?


  $ echo $(wc -l /var/log/ocsigen/access.log | awk '{print $1}')

Misaotra, Thanks, Merci.

       Architecte Informatique chez Blueline/Gulfsat:
    Administration Systeme, Recherche & Developpement
                +261 34 29 155 34 / +261 33 11 207 36

To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact

Reply to: