2008-09-04 Evi Vanoost <vanooste@rcbi.rochester.edu>

* 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
This commit is contained in:
guruevi 2008-09-04 18:42:41 +00:00
parent f1c59ff544
commit 440b614844
9 changed files with 148 additions and 125 deletions

View File

@ -1,3 +1,18 @@
2008-09-04 Evi Vanoost <vanooste@rcbi.rochester.edu>
* 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 <lserena@artica.es>
* linux/pandora_agent_installer: Added link to startup

View File

@ -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

View File

@ -0,0 +1,89 @@
#!/bin/bash
###############################################################################
#
# Copyright (c) 2008 Evi Vanoost <vanooste@rcbi.rochester.edu>
#
# 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 "<module>
<name>Pending Jobs (Cluster)</name>
<data>$PENDING</data>
<type>generic_data</type></module>
<module>
<name>Running Jobs (Cluster)</name>
<data>$RUNNING</data>
<type>generic_data</type></module>
<module>
<name>Number of Hosts (Cluster)</name>
<data>$HOSTS</data>
<type>generic_data</type></module>"
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 "<module>
<name>Available Slots (Q: $queue)</name>
<data>$AVAILSLOTS</data>
<type>generic_data</type>
</module>
<module>
<name>Used Slots (Q: $queue)</name>
<data>$USEDSLOTS</data>
<type>generic_data</type>
</module>
<module>
<name>Total Slots (Q: $queue)</name>
<data>$TOTALSLOTS</data>
<type>generic_data</type>
</module>
<module>
<name>Average load (Q: $queue)</name>
<data>$AVGLOAD</data>
<type>generic_data</type>
</module>
<module>
<name>Slots in Status aoACDS (Q: $queue)</name>
<data>$ADMSTATUS</data>
<type>generic_data</type>
</module>
<module>
<name>Slots in Status cdsuE (Q: $queue)</name>
<data>$ERRSTATUS</data>
<type>generic_data</type>
</module>"
done
echo "<module>
<name>Number of Queues</name>
<data>$NUMQUEUE</data>
<type>generic_data</type></module>"

View File

@ -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.
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.

View File

@ -1,3 +1,22 @@
#!/bin/sh
###############################################################################
#
# Copyright (c) 2007-2008 Evi Vanoost <vanooste@rcbi.rochester.edu>
#
# 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

View File

@ -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

View File

@ -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.
Requires ipmitool and php (4 or 5) on the machine the agent is running on.

View File

@ -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 <vanooste@rcbi.rochester.edu>
#
# 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 "<module><data>" substr(d,1,7) "</data>"; if ($1=="location") print "<name>" $2 " " $3 " " $4 " " $5 "</name><type>generic_data</type></module>";}'`
# ================================
# 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 "<module>"
#echo "<name>www.artica.es_WEBContenct</name>"
#echo "<type>generic_proc</type>"
#echo "<data>$MD5SUM</data>"
#echo "</module>"
# 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 "<module>"
#echo "<name>DNS_CHECK</name>"
#echo "<type>generic_proc</type>"
#echo "<data>$DNS_STATUS</data>"
#echo "</module>"
# 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 "<module>"
# echo "<name>PLC_DNS_CHECK</name>"
# echo "<type>generic_proc</type>"
# echo "<data>$PLC_STATUS</data>"
# echo "</module>"
# MODULE END ========================