mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 00:04:37 +02:00
These are some artifacts from the Linux installer. Unnecessary now.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@924 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
78283f7894
commit
04e6c202cc
@ -1,61 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Init script for Pandora FMS agent
|
|
||||||
# Generic GNU/Linux version
|
|
||||||
# Sancho Lerena, <slerena@gmail.com>
|
|
||||||
# v1.3.1
|
|
||||||
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: pandora_agent
|
|
||||||
# Required-Start: $network
|
|
||||||
# Required-Stop: $network
|
|
||||||
# Default-Start: S 2 3 4 5
|
|
||||||
# Default-Stop: 0 1 6
|
|
||||||
# Short-Description: start/stop pandora-agent daemon
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
|
|
||||||
PANDORA_PATH=/etc/pandora
|
|
||||||
DAEMON=/usr/bin/pandora_agent
|
|
||||||
PIDFILE=/var/run/pandora_agent.pid
|
|
||||||
LOGFILE=/var/log/pandora_agent.log
|
|
||||||
|
|
||||||
if [ ! -f $DAEMON ]
|
|
||||||
then
|
|
||||||
echo "Pandora FMS Agent not found at $DAEMON, please check setup"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
start)
|
|
||||||
PANDORA_PID=$(pidof -x $DAEMON)
|
|
||||||
if [ ! -z "$PANDORA_PID" ]
|
|
||||||
then
|
|
||||||
echo "Pandora FMS Agent is currently running on this machine with PID $PANDORA_PID"
|
|
||||||
echo "Cannot launch again. Aborting."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
nohup $DAEMON $PANDORA_PATH 2> $LOGFILE & PANDORA_PID=$!
|
|
||||||
echo $PANDORA_PID > $PIDFILE
|
|
||||||
echo "Pandora FMS Agent is now running with PID $PANDORA_PID"
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
PANDORA_PID=$(pidof -x $DAEMON)
|
|
||||||
if [ -z "$PANDORA_PID" ]
|
|
||||||
then
|
|
||||||
echo "Pandora FMS Agent is not running, cannot stop it. Aborting now..."
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo "Stopping Pandora Agent."
|
|
||||||
kill $PANDORA_PID > /dev/null 2>&1
|
|
||||||
rm -f $PANDORA_PID
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
force-reload|restart)
|
|
||||||
$0 stop
|
|
||||||
$0 start
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Uso: /etc/init.d/pandora_agent_daemon {start|stop|restart|force-reload}"
|
|
||||||
exit 1
|
|
||||||
esac
|
|
||||||
|
|
@ -1,81 +0,0 @@
|
|||||||
# 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.
|
|
||||||
#
|
|
||||||
# Please refer documentatation for more example and a more depth usage instructions
|
|
||||||
#
|
|
||||||
|
|
||||||
# ================================
|
|
||||||
# Temperature monitoring Mac OS X
|
|
||||||
# ===============================
|
|
||||||
|
|
||||||
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 ========================
|
|
Loading…
x
Reference in New Issue
Block a user