2008-06-17 Sancho Lerena <slerena@artica.es>
* config.pm: Added options for xprobe2, and autocreate.
* tools.pm: Added functions pandora_create_agent(), pandora_get_os(),
and pandora_event() (this has been moved from DB.pm).
* pandora_server.conf: Added options for xprobe2, autocreate and
autocreate_group.
* pandora_network: Added support for TCP scanning (not implemented in
console yet), parent detection using traceroute, OS fingerprinting with
xprobe2, event creation using central functions, and some optimizations.
* pandora_server: Added support for agent autocreation, OS detection from
the XML header, and event notification "new_agent" type.
* pandora_recon: First code to implement traceroute functionality
using Pureperl module. Added code for remote OS fingerprinting.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@874 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-17 19:26:03 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2008-09-08 18:12:57 +02:00
|
|
|
# Pandora FMS Prediction Server, startup script
|
|
|
|
# Copyright (c) 2006-2008 Sancho Lerena, <slerena@gmail.com>
|
2008-06-17 Sancho Lerena <slerena@artica.es>
* config.pm: Added options for xprobe2, and autocreate.
* tools.pm: Added functions pandora_create_agent(), pandora_get_os(),
and pandora_event() (this has been moved from DB.pm).
* pandora_server.conf: Added options for xprobe2, autocreate and
autocreate_group.
* pandora_network: Added support for TCP scanning (not implemented in
console yet), parent detection using traceroute, OS fingerprinting with
xprobe2, event creation using central functions, and some optimizations.
* pandora_server: Added support for agent autocreation, OS detection from
the XML header, and event notification "new_agent" type.
* pandora_recon: First code to implement traceroute functionality
using Pureperl module. Added code for remote OS fingerprinting.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@874 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-17 19:26:03 +02:00
|
|
|
# Linux Version (generic)
|
2008-09-08 18:12:57 +02:00
|
|
|
# v2.0 Build 080903
|
|
|
|
# http://www.pandorafms.com
|
2008-06-17 Sancho Lerena <slerena@artica.es>
* config.pm: Added options for xprobe2, and autocreate.
* tools.pm: Added functions pandora_create_agent(), pandora_get_os(),
and pandora_event() (this has been moved from DB.pm).
* pandora_server.conf: Added options for xprobe2, autocreate and
autocreate_group.
* pandora_network: Added support for TCP scanning (not implemented in
console yet), parent detection using traceroute, OS fingerprinting with
xprobe2, event creation using central functions, and some optimizations.
* pandora_server: Added support for agent autocreation, OS detection from
the XML header, and event notification "new_agent" type.
* pandora_recon: First code to implement traceroute functionality
using Pureperl module. Added code for remote OS fingerprinting.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@874 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-17 19:26:03 +02:00
|
|
|
|
|
|
|
# Configurable path and filenames
|
|
|
|
PANDORA_HOME="/etc/pandora/pandora_server.conf"
|
|
|
|
PANDORA_PID_PATH="/var/run"
|
|
|
|
PANDORA_PID=$PANDORA_PID_PATH/pandora_prediction.pid
|
|
|
|
PANDORA_DAEMON=/usr/local/bin/pandora_prediction
|
|
|
|
|
|
|
|
# Main script
|
|
|
|
|
|
|
|
if [ ! -d "$PANDORA_PID_PATH" ]
|
|
|
|
then
|
|
|
|
echo "Pandora FMS cannot write it's PID file in $PANDORA_PID_PATH. Please create that directory"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -f $PANDORA_DAEMON ]
|
|
|
|
then
|
|
|
|
echo "Pandora FMS Prediction Server not found, please check setup and read manual"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
OLD_PATH="`pwd`"
|
|
|
|
PANDORA_PID=$(pidof -x $PANDORA_DAEMON)
|
|
|
|
if [ ! -z $PANDORA_PID ]
|
|
|
|
then
|
|
|
|
echo "Pandora FMS Prediction Server is currently running on this machine with PID ($PANDORA_PID). Aborting now..."
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
rm -f $PANDORA_PID
|
|
|
|
fi
|
|
|
|
|
|
|
|
$PANDORA_DAEMON $PANDORA_HOME -D
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
PANDORA_PID=$(pidof -x $PANDORA_DAEMON)
|
|
|
|
if [ ! -z "$PANDORA_PID" ]
|
|
|
|
then
|
|
|
|
echo "Pandora FMS Prediction Server is now running with PID $PANDORA_PID"
|
|
|
|
else
|
|
|
|
echo "Cannot start Pandora FMS Prediction Server. Aborted."
|
|
|
|
fi
|
|
|
|
cd "$OLD_PATH"
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
PANDORA_PID=$(pidof -x $PANDORA_DAEMON)
|
|
|
|
if [ -z $PANDORA_PID ]
|
|
|
|
then
|
|
|
|
echo "Pandora FMS Prediction Server is not running, cannot stop it."
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
echo "Stopping Pandora FMS Prediction Server"
|
|
|
|
kill $PANDORA_PID > /dev/null 2>&1
|
|
|
|
rm -f $PANDORA_PID
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
force-reload|restart)
|
|
|
|
$0 stop
|
|
|
|
$0 start
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Usage: pandora_prediction {start|stop|restart}"
|
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
|