Update to 2.0. Also new installer
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@922 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
fbfac5d66d
commit
8a9672dd27
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Description</key>
|
||||
<string>Pandora FMS Agent 1.3 (Mac)</string>
|
||||
<key>OrderPreference</key>
|
||||
<string>None</string>
|
||||
<key>Provides</key>
|
||||
<array>
|
||||
<string>PandoraFMS</string>
|
||||
</array>
|
||||
<key>Uses</key>
|
||||
<array>
|
||||
<string>Network</string>
|
||||
<string>Resolver</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
#!/bin/bash
|
||||
# Init script for Pandora FMS agent
|
||||
# Generic GNU/Linux version
|
||||
# (c) Sancho Lerena, <slerena@gmail.com>
|
||||
# (c) Evi Vanoost <vanooste@rcbi.rochester.edu>
|
||||
# v2.0
|
||||
|
||||
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
|
||||
|
||||
. /etc/rc.common
|
||||
|
||||
StartService()
|
||||
{
|
||||
if [ -f $PIDFILE ]
|
||||
then
|
||||
PID_BA=`cat $PIDFILE`
|
||||
if [ ! -z "`ps -Af | awk '{ print $2 }' | grep $PID_BA`" ]
|
||||
then
|
||||
echo "Pandora FMS Agent is currently running on this machine with PID $PID_BA"
|
||||
echo "Cannot launch again. Aborting."
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
|
||||
nohup $DAEMON $PANDORA_PATH 2> $LOGFILE & MYPID=$!
|
||||
echo $MYPID > $PIDFILE
|
||||
echo "Pandora FMS Agent is now running with PID $MYPID"
|
||||
}
|
||||
|
||||
StopService()
|
||||
{
|
||||
if [ -f $PIDFILE ]
|
||||
then
|
||||
echo "Stopping Pandora Agent."
|
||||
PID_2=`cat $PIDFILE`
|
||||
if [ ! -z "`ps -f -p $PID_2 | grep -v grep | grep 'pandora_agent'`" ]
|
||||
then
|
||||
kill -9 $PID_2
|
||||
fi
|
||||
rm -f $PIDFILE
|
||||
else
|
||||
echo "Pandora FMS Agent is not running, cannot stop it. Aborting now..."
|
||||
fi
|
||||
}
|
||||
|
||||
RestartService()
|
||||
{
|
||||
$0 stop
|
||||
$0 start
|
||||
}
|
||||
|
||||
RunService "$1"
|
Loading…
Reference in New Issue