Things to Monitor with SNMP Monitoring Scripts


Using this method, you will only be able to send one line of an error message;[6] however, a single script can return a different line of output each time it runs, and Mon will report it each time (because Mon will consider each change in output a new alert).

Here are a few things that you might want to monitor with your custom monitoring scripts:

  • A sudden increase in page faults. (A bash script to do this called pagefaults.sh is included in the chapter17 directory on the CD-ROM.)[7]

  • A sudden increase or decrease in free swap space, or if free swap space is getting too close to the maximum. (See the script swap.sh also included on the CD-ROM in the chapter17 directory.)

  • The number of defunct[8] processes on the system.

  • Logins with very high idle (inactivity) times.

  • Processes consuming too much of the CPU.

  • Assuming you are using NFS clients, you may also want to monitor the number of IP reassembly failures (failed attempts by the kernel to reassemble network packets containing fragmented data) by examining the SNMP variable IP-MIB::ipReasmFails. Here is a sample command that will do this:

     #snmpwalk localhost -c public IP-MIB::ipReasmFails.0 

Note 

You can write a script that calls another script, but just be sure to pass the exit status of the child script back as the exit status of the main script or SNMPD will not see it.

[6]See the SNMP traps and sending SNMP trap alerts sections in the SNMP and Mon documentation if you need to send more than one-line error messages in your SNMP messages.

[7]The first time you run this script you'll see an error that you can ignore because the historical page faults information doesn't exist.

[8]Defunct processes are shown on a ps report and usually cannot be removed from the system without rebooting.



The Linux Enterprise Cluster. Build a Highly Available Cluster with Commodity Hardware and Free Software
Linux Enterprise Cluster: Build a Highly Available Cluster with Commodity Hardware and Free Software
ISBN: 1593270364
EAN: 2147483647
Year: 2003
Pages: 219
Authors: Karl Kopper

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net