From 440b614844dedeab4422a52d010250f19b9129c8 Mon Sep 17 00:00:00 2001 From: guruevi Date: Thu, 4 Sep 2008 18:42:41 +0000 Subject: [PATCH] 2008-09-04 Evi Vanoost * mac_osx/plugins/XServeRAID: Updated for 2.0 type agents. Added license information * mac_osx/plugins/SGE: Added SGE plugin. This is a shell script that will output the status of an SGE computing cluster. Best installed on the SGE Master * mac_osx/plugins/ppc_sensors: Updated for 2.0 type agents. Added license information * mac_osx/plugins/ipmi2xml: Renamed .txt to .php (what it should be). Updated to 2.0 type agents. Added license information git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1085 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_agents/ChangeLog | 15 ++++ pandora_agents/mac_osx/plugins/SGE/README.txt | 1 + pandora_agents/mac_osx/plugins/SGE/SGEStatus | 89 +++++++++++++++++++ .../mac_osx/plugins/XServeRAID/README.txt | 3 +- .../mac_osx/plugins/XServeRAID/check_xserve | 19 ++++ .../plugins/XServeRAID/pandora_agent.conf | 51 +---------- .../mac_osx/plugins/ipmi2xml/README.txt | 6 +- .../ipmi2xml/{ipmi2xml.txt => ipmi2xml.php} | 0 pandora_agents/mac_osx/plugins/ppc_sensors | 89 ++++--------------- 9 files changed, 148 insertions(+), 125 deletions(-) create mode 100644 pandora_agents/mac_osx/plugins/SGE/README.txt create mode 100755 pandora_agents/mac_osx/plugins/SGE/SGEStatus rename pandora_agents/mac_osx/plugins/ipmi2xml/{ipmi2xml.txt => ipmi2xml.php} (100%) diff --git a/pandora_agents/ChangeLog b/pandora_agents/ChangeLog index 2034b42f21..9ec9eccb42 100644 --- a/pandora_agents/ChangeLog +++ b/pandora_agents/ChangeLog @@ -1,3 +1,18 @@ +2008-09-04 Evi Vanoost + + * mac_osx/plugins/XServeRAID: Updated for 2.0 type agents. Added + license information + + * mac_osx/plugins/SGE: Added SGE plugin. This is a shell script that + will output the status of an SGE computing cluster. Best installed on + the SGE Master + + * mac_osx/plugins/ppc_sensors: Updated for 2.0 type agents. Added + license information + + * mac_osx/plugins/ipmi2xml: Renamed .txt to .php (what it should be). + Updated to 2.0 type agents. Added license information + 2008-09-03 SAncho Lerena * linux/pandora_agent_installer: Added link to startup diff --git a/pandora_agents/mac_osx/plugins/SGE/README.txt b/pandora_agents/mac_osx/plugins/SGE/README.txt new file mode 100644 index 0000000000..d383d4fcee --- /dev/null +++ b/pandora_agents/mac_osx/plugins/SGE/README.txt @@ -0,0 +1 @@ +This script can be used as a plugin in Pandora FMS. It will return an XML with the current status of an SGE cluster diff --git a/pandora_agents/mac_osx/plugins/SGE/SGEStatus b/pandora_agents/mac_osx/plugins/SGE/SGEStatus new file mode 100755 index 0000000000..9d76a89a13 --- /dev/null +++ b/pandora_agents/mac_osx/plugins/SGE/SGEStatus @@ -0,0 +1,89 @@ +#!/bin/bash +############################################################################### +# +# Copyright (c) 2008 Evi Vanoost +# +# SGEStatus: A quick shell script that can be used as a Pandora plugin to +# display the SGE cluster status +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +############################################################################### + + +SGE_BIN="/RCBI/sge/bin/darwin-ppc" + +PENDING=$[`$SGE_BIN/qstat -s p | grep " qw " | wc -l`+0] +RUNNING=$[`$SGE_BIN/qstat -s a | grep " r " | wc -l`+0] +HOSTS=$[`qhost | wc -l`-3] +QUEUES=`qstat -g c | grep -v '\-\-\-' | grep -v "CLUSTER QUEUE" | awk '{print $1}'` +NUMQUEUE=0 + +echo " + Pending Jobs (Cluster) + $PENDING + generic_data + + Running Jobs (Cluster) + $RUNNING + generic_data + + Number of Hosts (Cluster) + $HOSTS + generic_data" + +for queue in $QUEUES +do + NUMQUEUE=$[$NUMQUEUE+1] + # CLUSTER QUEUE CQLOAD USED AVAIL TOTAL aoACDS cdsuE + # 64bit 0.15 0 8 22 0 14 + QINFO=`qstat -g c | grep $queue` + AVGLOAD=`echo $QINFO | awk '{print $2}'` + USEDSLOTS=`echo $QINFO | awk '{print $3}'` + AVAILSLOTS=`echo $QINFO | awk '{print $4}'` + TOTALSLOTS=`echo $QINFO | awk '{print $5}'` + ADMSTATUS=`echo $QINFO | awk '{print $6}'` + ERRSTATUS=`echo $QINFO | awk '{print $7}'` + echo " + Available Slots (Q: $queue) + $AVAILSLOTS + generic_data + + + Used Slots (Q: $queue) + $USEDSLOTS + generic_data + + + Total Slots (Q: $queue) + $TOTALSLOTS + generic_data + + + Average load (Q: $queue) + $AVGLOAD + generic_data + + + Slots in Status aoACDS (Q: $queue) + $ADMSTATUS + generic_data + + + Slots in Status cdsuE (Q: $queue) + $ERRSTATUS + generic_data + " +done + +echo " + Number of Queues + $NUMQUEUE + generic_data" diff --git a/pandora_agents/mac_osx/plugins/XServeRAID/README.txt b/pandora_agents/mac_osx/plugins/XServeRAID/README.txt index c3212d1ad8..6daca20d1e 100644 --- a/pandora_agents/mac_osx/plugins/XServeRAID/README.txt +++ b/pandora_agents/mac_osx/plugins/XServeRAID/README.txt @@ -6,4 +6,5 @@ The monitoring packages (xserve-raid-tools-1.2.*) also include Nagios plugins. The pandora_agent.conf has all the configuration modules for each part of an XServe RAID (every single drive module can be monitored). -For the agent itself, you'll have to use or clone a Mac, Unix or Linux client and overwrite the configuration with this one. I tested this and it's running on Mac OS X 10.4 and 10.5 in my environment. \ No newline at end of file +For the agent itself, you'll have to use or clone a Mac, Unix or Linux client and overwrite the configuration with this one. +I tested this and it's running on Mac OS X 10.4 and 10.5 in my environment. diff --git a/pandora_agents/mac_osx/plugins/XServeRAID/check_xserve b/pandora_agents/mac_osx/plugins/XServeRAID/check_xserve index 43d33466f8..cd352c2f46 100755 --- a/pandora_agents/mac_osx/plugins/XServeRAID/check_xserve +++ b/pandora_agents/mac_osx/plugins/XServeRAID/check_xserve @@ -1,3 +1,22 @@ #!/bin/sh +############################################################################### +# +# Copyright (c) 2007-2008 Evi Vanoost +# +# check_xserve: This script reads out the check_xserve_raid utils to use in the +# Pandora configuration. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +############################################################################### + + /usr/local/bin/check_xserve_raid --address 0.0.0.0 --debug --debug > /private/var/root/xserve-status cat /private/var/root/xserve-status | grep "lhs.array1 optimal, rhs.array1 optimal" | wc -l diff --git a/pandora_agents/mac_osx/plugins/XServeRAID/pandora_agent.conf b/pandora_agents/mac_osx/plugins/XServeRAID/pandora_agent.conf index 885f1b3e4a..e8811dd1d7 100644 --- a/pandora_agents/mac_osx/plugins/XServeRAID/pandora_agent.conf +++ b/pandora_agents/mac_osx/plugins/XServeRAID/pandora_agent.conf @@ -1,53 +1,4 @@ -# Base config file for Pandora FMS agents -# Version 1.2 -# Licensed under GPL license v2, -# (c) 2003-2007 Sancho Lerena and others. -# please visit http://pandora.sourceforge.net - -# General Parameters -# ================== - -server_ip skull -server_path /var/spool/pandora/data_in -temporal /var/spool/pandora-xserve/data_out -logfile /var/log/pandora/pandora_agent-xserve.log - -# Interval in seconds, 300 by default -interval 300 - -# Debug mode only generate XML, and stop after first execution, -# and does not copy XML to server. -debug 0 - -# By default is activated -checksum 0 - -# By default, agent takes machine name -agent_name XServe-RAID-1 - -# By default agent try to take default encoding defined in host. -# encoding iso-8859-15 - -# By default is 22 (for ssh) -#server_port 22 - -# ftp, ssh or local -transfer_mode ssh - -# delayed_startup defines number of MINUTES before start execution -# for first time when startup Pandora Agent - -#delayed_startup 90 - -#Pandora nice defines priority of execution. Less priority means more intensive execution -#A recommended value is 10. 0 priority means no Pandora CPU protection enabled -#pandora_nice 0 - - -# Module Definition -# ================= - -# System information +#This is a sample Pandora config script for the XServe RAID status script module_begin module_name XServe Health diff --git a/pandora_agents/mac_osx/plugins/ipmi2xml/README.txt b/pandora_agents/mac_osx/plugins/ipmi2xml/README.txt index c938032e4e..4ee0469912 100644 --- a/pandora_agents/mac_osx/plugins/ipmi2xml/README.txt +++ b/pandora_agents/mac_osx/plugins/ipmi2xml/README.txt @@ -1,8 +1,8 @@ -This is a simple script that could be called from within pandora_user.conf -It will call an IPMI-capable host (IP-address) and acquire it's sensors, then parse them into an understandable XML file for Pandora FMS. +This is a plugin that can be called from within the Pandora configuration file. +It will call an IPMI-capable host (IP-address) and acquire it's sensors, then parse them into an understandable XML file for Pandora FMS. Make sure you set up a the correct name for the agent configuration if the monitoring is done from another host than the one the IPMI chip is located at. This script might not work and has only been tested so far against an Intel-based Apple XServe but the script is built up so it should acquire any. -ipmitool and php (tested 5, 4 should work too) is required on the machine the agent is running on. \ No newline at end of file +Requires ipmitool and php (4 or 5) on the machine the agent is running on. diff --git a/pandora_agents/mac_osx/plugins/ipmi2xml/ipmi2xml.txt b/pandora_agents/mac_osx/plugins/ipmi2xml/ipmi2xml.php similarity index 100% rename from pandora_agents/mac_osx/plugins/ipmi2xml/ipmi2xml.txt rename to pandora_agents/mac_osx/plugins/ipmi2xml/ipmi2xml.php diff --git a/pandora_agents/mac_osx/plugins/ppc_sensors b/pandora_agents/mac_osx/plugins/ppc_sensors index d764ec0368..445531c51a 100755 --- a/pandora_agents/mac_osx/plugins/ppc_sensors +++ b/pandora_agents/mac_osx/plugins/ppc_sensors @@ -1,13 +1,24 @@ -# Pandora User-Defined adquisition script -# This code is under GPL licence -# This is the default user script file -# If you're using this is because default config doest fit all your needs -# You can use the following variables +############################################################################### # -# All STDOUT output will be written in final XML file sent to Pandora Server. +# Copyright (c) 2007-2008 Evi Vanoost # -# Please refer documentatation for more example and a more depth usage instructions +# ppc_sensors: A quick shell script that uses the ioreg command on Mac OS X to +# find and display the status and information of all sensors. As far +# as I know this doesn't work on Intel machines except for the video +# card sensors. If you find a way to read out the machine sensors on +# Intel machines, please let me know. # +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +############################################################################### # ================================ # Temperature monitoring Mac OS X @@ -15,67 +26,3 @@ echo `ioreg -n IOHWSensor | awk '/location/ || /current-value/ || /"type"/' | sed -e 's/\n//' -e 's/[^"]*"//' -e 's/" =//' -e 's/"//g' | awk '{ d=($2/65536); if ($1=="current-value") print "" substr(d,1,7) ""; if ($1=="location") print "" $2 " " $3 " " $4 " " $5 "generic_data";}'` -# ================================ -# Check for WEBPage content change -# ================================ - -#MYMD5=`echo -e "GET / HTTP/1.0\n\n\n" | nc -w 30 www.artica.es 80 | grep -v "Date:" | md5sum | awk '{ print $1 }'` -#VALIDMD5=e85c0b9018a22c1086c8e0179cd224b1 -#if [ "$MYMD5" != "$VALIDMD5" ] -#then -# MD5SUM=0 -#else -# MD5SUM=1 -#fi -#echo "" -#echo "www.artica.es_WEBContenct" -#echo "generic_proc" -#echo "$MD5SUM" -#echo "" - -# MODULE END ======================== - -# ================================ -# Check for DNS Entry change -# ================================ - -#HOSTNAME=arcadia.genterara.com -#MAXHOPS=1 -#MAXHOPS2=`expr $MAXHOPS + 1` -#SALIDA=`traceroute -n $HOSTNAME -w 5 -m $MAXHOPS2 2> /dev/null | awk '{ print $1 }' | tail -1` -# if SALIDA != MAXHOPS, error (more than MAXHOPS hop, if this is our local IP, no more than MAXHOPS hop its needed -#if [ "$SALIDA" == "$MAXHOPS" ] -#then -# DNS_STATUS=1 -#else -# DNS_STATUS=0 -#fi -#echo "" -#echo "DNS_CHECK" -#echo "generic_proc" -#echo "$DNS_STATUS" -#echo "" - -# MODULE END ======================== - - -# ================================ -# Check for DNS Entry change -# on local interface ppp0 -# ================================ - -# PLC_DNS=`dig @194.179.1.101 plc.genterara.com A +short | tail -1 ` -# PLC_LOCAL=`ifconfig ppp0 | head -2 | tail -1 | tr -s ":" " " | awk ' { print $3 } '` -# if [ "$PLC_DNS" == "$PLC_LOCAL" ] -# then -# PLC_STATUS=1 -# else -# PLC_STATUS=0 -# fi -# -# echo "" -# echo "PLC_DNS_CHECK" -# echo "generic_proc" -# echo "$PLC_STATUS" -# echo "" -# MODULE END ========================