#!/usr/bin/perl -w
# check_digitemp.pl Copyright (C) 2002 by Brian C. Lane <bcl@brianlane.com>
#
# This is a NetSaint plugin script to check the temperature on a local
# machine. Remote usage may be possible with SSH
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# ===========================================================================
# Howto Install in NetSaint (tested with v0.0.7)
#
# 1. Copy this script to /usr/local/netsaint/libexec/ or wherever you have
# placed your NetSaint plugins
#
# 2. Create a digitemp config file in /usr/local/netsaint/etc/
# eg. digitemp -i -s/dev/ttyS0 -c /usr/local/netsaint/etc/digitemp.conf
#
# 3. Make sure that the webserver user has permission to access the serial
# port being used.
#
# 4. Add a command to /usr/local/netsaint/etc/commands.cfg like this:
# command[check-temp]=$USER1$/check_digitemp.pl -w $ARG1$ -c $ARG2$ \
# -t $ARG3$ -f $ARG4$
# (fold into one line)
#
# 5. Tell NetSaint to monitor the temperature by adding a service line like
# this to your hosts.cfg file:
# service[kermit]=Temperature;0;24x7;3;5;1;home-admins;120;24x7;1;1;1;; \
# check-temp!65!75!1!/usr/local/netsaint/etc/digitemp.conf
# (fold into one line)
# 65 is the warning temperature
# 75 is the critical temperature
# 1 is the sensor # (as reported by digitemp -a) to monitor
# digitemp.conf is the path to the config file
#
# 6. If you use Centigrade instead of Fahrenheit, change the commands.cfg
# line to include the -C argument. You can then pass temperature limits in
# Centigrade in the service line.
#
# ===========================================================================
# Howto Install in Nagios (tested with v1.0b4)
#
# 1. Copy this script to /usr/local/nagios/libexec/ or wherever you have
# placed your Nagios plugins
#
# 2. Create a digitemp config file in /usr/local/nagios/etc/
# eg. digitemp -i -s/dev/ttyS0 -c /usr/local/nagios/etc/digitemp.conf
#
# 3. Make sure that the webserver user has permission to access the serial
# port being used.
#
# 4. Add a command to /usr/local/nagios/etc/checkcommands.cfg like this:
#
# #DigiTemp temperature check command
# define command{
# command_name check_temperature
# command_line $USER1$/check_digitemp.pl -w $ARG1$ -c $ARG2$ \
# -t $ARG3$ -f $ARG4$
# (fold above into one line)
# }
#
# 5. Tell NetSaint to monitor the temperature by adding a service line like
# this to your service.cfg file:
#
# #DigiTemp Temperature check Service definition
# define service{
# use generic-service
# host_name kermit
# service_description Temperature
# is_volatile 0
# check_period 24x7
# max_check_attempts 3
# normal_check_interval 5
# retry_check_interval 2
# contact_groups home-admins
# notification_interval 240
# notification_period 24x7
# notification_options w,u,c,r
# check_command check_temperature!65!75!1! \
# /usr/local/nagios/etc/digitemp.conf
# (fold into one line)
# }
#
=1= |