I've followed the thread on exec examples, but I'm still having some
trouble of my own. I have the following lines in my snmpd.conf file:
extend .1.3.6.1.4.1.7594.400 swap_percent
/etc/snmp/bin/check_swap_pct.bash
monitor -r 10 -u citadelInternal -o .1.3.6.1.4.1.7594.400.101
"cig-swap_percent" .1.3.6.1.4.1.7594.400.100 = 0
The script check_swap_pct.bash is a simple bash script which returns a
number which equals percent swap used as a whole number, and also
returns this same number as its exit status.something like:
#!/bin/bash
PCT=`/usr/bin/free -t | awk '$1 ~ /Swap:/ {print $3/$2 * 100 }' - | awk
-F. '{print $1}'`
echo $PCT
exit $PCT
When I run an snmpwalk I get the following data, which I am having
trouble understanding.and the monitor line from the snmpd.conf file is
not working as I would like/expect:
[EMAIL PROTECTED] snmp# snmpwalk -v 2c -c public localhost
.1.3.6.1.4.1.7594
SNMPv2-SMI::enterprises.7594.400.1.0 = INTEGER: 1
SNMPv2-SMI::enterprises.7594.400.2.1.2.12.115.119.97.112.95.112.101.114.
99.101.110.116 = STRING: "/etc/snmp/bin/check_swap_pct.bash"
SNMPv2-SMI::enterprises.7594.400.2.1.3.12.115.119.97.112.95.112.101.114.
99.101.110.116 = ""
SNMPv2-SMI::enterprises.7594.400.2.1.4.12.115.119.97.112.95.112.101.114.
99.101.110.116 = ""
SNMPv2-SMI::enterprises.7594.400.2.1.5.12.115.119.97.112.95.112.101.114.
99.101.110.116 = INTEGER: 5
SNMPv2-SMI::enterprises.7594.400.2.1.6.12.115.119.97.112.95.112.101.114.
99.101.110.116 = INTEGER: 1
SNMPv2-SMI::enterprises.7594.400.2.1.7.12.115.119.97.112.95.112.101.114.
99.101.110.116 = INTEGER: 1
SNMPv2-SMI::enterprises.7594.400.2.1.20.12.115.119.97.112.95.112.101.114
.99.101.110.116 = INTEGER: 4
SNMPv2-SMI::enterprises.7594.400.2.1.21.12.115.119.97.112.95.112.101.114
.99.101.110.116 = INTEGER: 1
SNMPv2-SMI::enterprises.7594.400.3.1.1.12.115.119.97.112.95.112.101.114.
99.101.110.116 = STRING: "0"
SNMPv2-SMI::enterprises.7594.400.3.1.2.12.115.119.97.112.95.112.101.114.
99.101.110.116 = STRING: "0"
SNMPv2-SMI::enterprises.7594.400.3.1.3.12.115.119.97.112.95.112.101.114.
99.101.110.116 = INTEGER: 1
SNMPv2-SMI::enterprises.7594.400.3.1.4.12.115.119.97.112.95.112.101.114.
99.101.110.116 = INTEGER: 0
SNMPv2-SMI::enterprises.7594.400.4.1.2.12.115.119.97.112.95.112.101.114.
99.101.110.116.1 = STRING: "0"
I hope this provides all the detail necessary to help a beginner get
some of the extensible functionality for custom scripts going. =)
Thanks in advance.
-Eric
------------------------------------------------------------------------
-------------------------
-------------------------
CONFIDENTIALITY AND SECURITY NOTICE
The contents of this message and any attachments may be privileged,
confidential and proprietary and also may be covered by the Electronic
Communications Privacy Act. If you are not an intended recipient, please
inform the sender of the transmission error and delete this message
immediately without reading, disseminating, distributing or copying the
contents. Citadel makes no assurances that this e-mail and any
attachments are free of viruses and other harmful code.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
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