snmpconf
/etc/snmp/snmp/snmp.conf
proc  sendmail
proc  popa3d
proc  proftpd
proc  httpd
proc  mysqld
disk  /
load  30 25 20
exec smart0 /bin/sh /etc/snmp/snmp/smartcheck.0
smartcheck.0
#!/bin/sh
if /usr/sbin/smartctl -a -i -d cciss,0 /dev/cciss/c0d0 | /bin/grep Status | /bin/grep OK 1>/dev/null 2>/dev/null; then
echo “OK: 0/cciss”;
exit 1;
else
echo “ALERT: 0/cciss”;
exit 2;
fi
[root@gwmail5 /]# snmpwalk -v 2c -c public hostname extTable
UCD-SNMP-MIB::extIndex.1 = INTEGER: 1
UCD-SNMP-MIB::extIndex.2 = INTEGER: 2
UCD-SNMP-MIB::extIndex.3 = INTEGER: 3
UCD-SNMP-MIB::extNames.1 = STRING: smart0
UCD-SNMP-MIB::extNames.2 = STRING: smart1
UCD-SNMP-MIB::extNames.3 = STRING: smart2
UCD-SNMP-MIB::extCommand.1 = STRING: /bin/sh
UCD-SNMP-MIB::extCommand.2 = STRING: /bin/sh
UCD-SNMP-MIB::extCommand.3 = STRING: /bin/sh
UCD-SNMP-MIB::extResult.1 = INTEGER: 1
UCD-SNMP-MIB::extResult.2 = INTEGER: 1
UCD-SNMP-MIB::extResult.3 = INTEGER: 1
UCD-SNMP-MIB::extOutput.1 = STRING: OK: 0/cciss
UCD-SNMP-MIB::extOutput.2 = STRING: OK: 1/cciss
UCD-SNMP-MIB::extOutput.3 = STRING: OK: 2/cciss
UCD-SNMP-MIB::extErrFix.1 = INTEGER: 0
UCD-SNMP-MIB::extErrFix.2 = INTEGER: 0
UCD-SNMP-MIB::extErrFix.3 = INTEGER: 0
UCD-SNMP-MIB::extErrFixCmd.1 = STRING:
UCD-SNMP-MIB::extErrFixCmd.2 = STRING:
UCD-SNMP-MIB::extErrFixCmd.3 = STRING:
This entry was posted on Wednesday, October 8th, 2008 at 3:06 pm and is filed under Mẹo vặt của hiếu râu. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a reply

Name (*)
Mail (will not be published) (*)
URI
Comment