[mythtv-users] OT: Monitoring CPU/Internal Temperature through Linux

Chris Isip cmisipster at gmail.com
Tue May 1 22:22:03 UTC 2007


I have attached  the scripts.

Entries in /etc/nagios/minimal.cfg

# Command to check mythtv on the local machine

define command{
        command_name    check_local_mythtv
        command_line    $USER1$/check_tcp -w $ARG1$ -c $ARG2$ -p6543
        }


****Check tcp is part of the nagios distribution. I use 60 and 120 for -w
and -c.

check_command                   check_local_mythtv!60!120
-----------------------------------------------------------------------------------------------------------------------------

# Command to check smart status on the local machine

define command{
        command_name    check_local_smart
        command_line    $USER1$/check_smart.pl $ARG1$
        }


****I got this one from the internet somewhere.  I use

check_command                   check_local_smart!-td/dev/hda

--------------------------------------------------------------------------------------------------------------------------------

# Command to check the CPU temperature status

define command{
        command_name    check_local_cpu
        command_line    $USER1$/check_cpu_temp
        }

        check_command                   check_local_cpu
---------------------------------------------------------------------------------------------------------------------------------

# Command to check the motherboard temperature status

define command{
        command_name    check_local_mb
        command_line    $USER1$/check_mb_temp
        }

check_command                   check_local_mb
--------------------------------------------------------------------------------------------------------------------------------

# Command to check the fan status

define command{
        command_name    check_local_cpu_fan
        command_line    $USER1$/check_cpu_fan
        }

check_command                   check_local_cpu_fan

------------------------------------------------------------------------------------------------------------------------------------
Example of an event handler (this case, restarting mythbackend)

define command{
        command_name    restart-mythbackend
        command_line
/usr/lib/nagios/plugins/eventhandlers/restart-mythbackend  $SERVICESTATE$
$HOSTSTATETYPE$ $SERVICEATTEMPT$
        }

----------------------------------------------------------------------------------------------------------------------------------------

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.

I have also attached a sample event handler.  Make sure your nagios user has
privileges to run the plugins and event handlers.

Cheers.  I hope posting this will not mess up the formatting.

Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-users/attachments/20070501/812b21fa/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: check_smart.pl
Type: application/x-perl
Size: 5201 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-users/attachments/20070501/812b21fa/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: check_cpu_fan
Type: application/octet-stream
Size: 456 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-users/attachments/20070501/812b21fa/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: check_cpu_temp
Type: application/octet-stream
Size: 475 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-users/attachments/20070501/812b21fa/attachment-0001.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: check_mb_temp
Type: application/octet-stream
Size: 480 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-users/attachments/20070501/812b21fa/attachment-0002.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: restart-mythbackend
Type: application/octet-stream
Size: 407 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-users/attachments/20070501/812b21fa/attachment-0003.obj 


More information about the mythtv-users mailing list