I have attached the scripts. <br><br>Entries in /etc/nagios/minimal.cfg<br><br># Command to check mythtv on the local machine<br><br>define command{<br> command_name check_local_mythtv<br> command_line $USER1$/check_tcp -w $ARG1$ -c $ARG2$ -p6543
<br> }<br><br><br>****Check tcp is part of the nagios distribution. I use 60 and 120 for -w and -c.<br><br>check_command check_local_mythtv!60!120<br>-----------------------------------------------------------------------------------------------------------------------------
<br><br># Command to check smart status on the local machine<br><br>define command{<br> command_name check_local_smart<br> command_line $USER1$/check_smart.pl $ARG1$<br> }<br><br><br>****I got this one from the internet somewhere. I use
<br><br>check_command check_local_smart!-td/dev/hda<br><br>--------------------------------------------------------------------------------------------------------------------------------<br><br># Command to check the CPU temperature status
<br><br>define command{<br> command_name check_local_cpu<br> command_line $USER1$/check_cpu_temp<br> }<br><br> check_command check_local_cpu<br>---------------------------------------------------------------------------------------------------------------------------------
<br><br># Command to check the motherboard temperature status<br><br>define command{<br> command_name check_local_mb<br> command_line $USER1$/check_mb_temp<br> }<br><br>check_command check_local_mb
<br>--------------------------------------------------------------------------------------------------------------------------------<br><br># Command to check the fan status<br><br>define command{<br> command_name check_local_cpu_fan
<br> command_line $USER1$/check_cpu_fan<br> }<br><br>check_command check_local_cpu_fan<br><br>------------------------------------------------------------------------------------------------------------------------------------
<br>Example of an event handler (this case, restarting mythbackend)<br><br>define command{<br> command_name restart-mythbackend<br> command_line /usr/lib/nagios/plugins/eventhandlers/restart-mythbackend $SERVICESTATE$ $HOSTSTATETYPE$ $SERVICEATTEMPT$
<br> }<br><br>----------------------------------------------------------------------------------------------------------------------------------------<br><br>Like I said, you may need to modify them for your system. At least gives you an idea how to start. If you can get bash or perl to output the appropriate rc numbers, you can get nagios to do anything. I also recommend checking for the status of NTP, Mysql, available disk space. You can look at nagios' Trends report to see how these values change over a period of time.
<br><br>I have also attached a sample event handler. Make sure your nagios user has privileges to run the plugins and event handlers.<br><br>Cheers. I hope posting this will not mess up the formatting.<br><br>Chris<br><br>
<br><br>