Dell Power Edge plugin for nagios nagios_check_temps

Marc Powell marc at ena.com
Mon Jan 3 19:31:55 CET 2005


Please reply to the list so that others may benefit...



> -----Original Message-----
> From: Eduardo Martinez [mailto:emartine at bsd.uchicago.edu]
> Sent: Monday, January 03, 2005 10:48 AM
> To: Marc Powell
> Subject: Re: [Nagios-users] Dell Power Edge plugin for nagios
> nagios_check_temps
> 
> You are correct... These are not standard plugins. I do remember
getting
> to these pages from nagios.org though.
> There was a link to an article that showed these (my bookmarks)
> www.dell.com/downloads/global/power/1q04-sch.pdf
> www.dell.com/downloads/global/power/ps1q04-sch_oe.pdf
> 
> I tried using the --help command
> ------------------------- help command -------------------
> ./nagios_check_temps --help
> nagios_check_temps (nagios-plugins 1.3.1) 1.0
> The nagios plugins come with ABSOLUTELY NO WARRANTY. You may
redistribute
> copies of the plugins under the terms of the GNU General Public
License.
> For more information about these matters, see the file named COPYING.
> 
> Usage: nagios_check_temps
> 
> This plugin checks Dell PowerEdge temperatures using Dell's
OpenManage.
> 
> Send email to nagios-users at lists.sourceforge.net if you have questions
> regarding use of this software. To submit patches or suggest
improvements,
> send email to nagiosplug-devel at lists.sourceforge.net
> ----------------------------------------------------------------
> 
> Here is the plugin
> 
>
-------------------------nagios_check_temps-----------------------------
--
> --
> 
> #! /bin/sh
> 
> PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
> 
> 
> PROGNAME=`basename $0`
> 
> PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'`
> REVISION=`echo '$Revision: 1.0 $' | sed -e 's/[^0-9.]//g'`
> 
> . $PROGPATH/utils.sh
> 
> print_usage() {
> echo "Usage: $PROGNAME"
> }
> 
> print_help() {
> 
>         print_revision $PROGNAME $REVISION
>         echo ""
> 
> print_usage
> 
> echo ""
> echo "This plugin checks Dell PowerEdge temperatures using Dell's
> OpenManage."
> echo ""
> support
> exit 0
> }
> 
> case "$1" in
> --help)
> print_help
> exit 0
> ;;
> -h)
> print_help
> :wqexit 0
> ;;
> --version)
> print_revision $PROGNAME $REVISION
> exit 0
> ;;
> -V)
> print_revision $PROGNAME $REVISION
> exit 0
> ;;
> *)
> criticalstate=""
> warningstate=""
> for index in `omreport chassis temps|grep Index| awk '{ print $3 }'`
> do
> omreport chassis temps index=${index} -outa /tmp/delltemps.$$
> temp=`grep Reading /tmp/delltemps.$$|awk '{ print $3 }'`
> tempcomp=`grep Reading /tmp/delltemps.$$|awk '{ print $3 }'|sed
s/[.]//`
> warncomp=`grep "Maximum Warning" /tmp/delltemps.$$|awk '{ print $5
> }'|sed s/[.]//`
> critcomp=`grep "Maximum Failure" /tmp/delltemps.$$|awk '{ print $5
> }'|sed s/[.]//`
> probename=`grep "Probe Name" /tmp/delltemps.$$|awk '{ print $4, $5,
$6,
> $7, $8 }'`
> if (($tempcomp >= $critcomp)); then
> probes[${index}]=`echo "[] $probename ${temp} Celsius-CRITICAL "`
> criticalstate=1
> else
> if (($tempcomp >= $warncomp)); then
> probes[${index}]=`echo "[] $probename ${temp} Celsius-WARNING "`
> warningstate=1
> else
> probes[${index}]=`echo "[] $probename ${temp} Celsius-OK "`
> fi
> fi
> rm /tmp/delltemps.$$
> done
> if test "$1" = "-v" -o "$1" = "--verbose"; then
> echo ${probes[*]}
> fi
> if [ $criticalstate ]; then
> echo "Temperatures CRITICAL!!!: ${probes[*]}"
> exit 2
> elif [ $warningstate ]; then
> echo "Temperatures Warning!: ${probes[*]}"
> exit 1
> else
> echo "Temperatures OK"
> exit 0
> fi
> ;;
> esac
> ----------------------------------------------------------------
> 
> Here is my check_command, it has varied. This is what I am having an
> issue with.
> 
> 
> --------------------check_commands.cfg----------------------
> # 'nagios_check_temps' command definition
>         define command{
>         command_name    nagios_check_temps
>         command_line    /opt/nagios/libexec/nagios_check_temps
> $HOSTADDRESS$
> }
> -----------------------------------------------------------------
> 
> Here is the services_host.cfg file, which also varied.
> 
> ----------------services_omchecks.cfg--------------------------------
> define service{
>        use                                 om_template
>        hostgroup                       om_template
>        service_description         OM Temperature Checks
>        check_command
> check_nrpe!nagios_check_temps!'Temperature Warning'!'Temperatures
> CRITICAL!!!'
> }
>
-----------------------------------------------------------------------
> 
> 
> I have much to learn about understanding scripting and I am not a
> programmer. Though I understand the logic, i'm not sure what output it
> is expecting.

The plugin above is not network aware and simply runs the command
`omreport chassis temps` on the host it is run on and parses that
output. It accepts no command line arguments other than a -v for verbose
output. You can not pass it warning and critical thresholds as it
figures those out from the "Maximum Warning" and "Maximum Failure"
output of omreport. Your service definition check command should simply
be --

check_command check_nrpe!nagios_check_temps

presuming that you have a 'nagios_check_temps' command definition in
your nrpe.cfg on the remote machine ala --

command[nagios_check_temps]=/path/to/nagios_check_temps

and nagios_check_temps is installed on the machine you are wanting to
check the temperature on in the location specified in the nrpe.cfg
command definition. The command definition that you included above isn't
used at all, at least by the service definition you included.

You didn't give any indication about what the actual problem was you
were experiencing so that's about all I can tell you.

--
Marc



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list