2008-09-08 Raul Mateos <raulofpandora@gmail.com>
* pandora_*: Updated headers with build and new URL, better style git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1088 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
f66de3bce0
commit
663170fb5b
|
@ -3,6 +3,8 @@
|
|||
* util/pandora_db.pl: Updated year and URL.
|
||||
|
||||
* util/pandora_dbstress.pl: Updated year and build.
|
||||
|
||||
* pandora_*: Updated headers with build and new URL, better style
|
||||
|
||||
2008-09-03 Sancho Lerena <slerena@gmail.com>
|
||||
|
||||
|
@ -14,8 +16,8 @@
|
|||
|
||||
2008-09-01 Sancho Lerena <slerena@gmail.com>
|
||||
|
||||
* lib/PandoraFMS/DB.pm: Sending mail now replaces macros also
|
||||
in the subject.
|
||||
* lib/PandoraFMS/DB.pm: Sending mail now replaces macros also
|
||||
in the subject.
|
||||
|
||||
2008-08-28 Evi Vanoost <vanooste@rcbi.rochester.edu>
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Pandora FMS Network Server, startup script
|
||||
# Sancho Lerena, <slerena@gmail.com>
|
||||
# Copyright (c) 2006-2008 Sancho Lerena, <slerena@gmail.com>
|
||||
# Linux Version (generic)
|
||||
# v1.3 Build 070731
|
||||
# v2.0 Build 080903
|
||||
# http://www.pandorafms.com
|
||||
|
||||
# Configurable path and filenames
|
||||
PANDORA_HOME="/etc/pandora/pandora_server.conf"
|
||||
|
@ -21,52 +22,52 @@ fi
|
|||
|
||||
if [ ! -f $PANDORA_DAEMON ]
|
||||
then
|
||||
echo "Pandora FMS Network Server not found, please check setup and read manual"
|
||||
exit
|
||||
echo "Pandora FMS Network 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
|
||||
start)
|
||||
OLD_PATH="`pwd`"
|
||||
PANDORA_PID=$(pidof -x $PANDORA_DAEMON)
|
||||
if [ ! -z $PANDORA_PID ]
|
||||
then
|
||||
echo "Pandora FMS Network 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
|
||||
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 Network Server is now running with PID $PANDORA_PID"
|
||||
else
|
||||
echo "Cannot start Pandora FMS Network Server. Aborted."
|
||||
fi
|
||||
cd "$OLD_PATH"
|
||||
;;
|
||||
stop)
|
||||
PANDORA_PID=$(pidof -x $PANDORA_DAEMON)
|
||||
if [ -z $PANDORA_PID ]
|
||||
then
|
||||
echo "Pandora FMS Network Server is not running, cannot stop it."
|
||||
exit 1
|
||||
else
|
||||
echo "Stopping Pandora FMS Network Server"
|
||||
kill $PANDORA_PID > /dev/null 2>&1
|
||||
rm -f $PANDORA_PID
|
||||
fi
|
||||
;;
|
||||
force-reload|restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: pandora_network {start|stop|restart}"
|
||||
exit 1
|
||||
PANDORA_PID=$(pidof -x $PANDORA_DAEMON)
|
||||
if [ ! -z "$PANDORA_PID" ]
|
||||
then
|
||||
echo "Pandora Network Server is now running with PID $PANDORA_PID"
|
||||
else
|
||||
echo "Cannot start Pandora FMS Network Server. Aborted."
|
||||
fi
|
||||
cd "$OLD_PATH"
|
||||
;;
|
||||
stop)
|
||||
PANDORA_PID=$(pidof -x $PANDORA_DAEMON)
|
||||
if [ -z $PANDORA_PID ]
|
||||
then
|
||||
echo "Pandora FMS Network Server is not running, cannot stop it."
|
||||
exit 1
|
||||
else
|
||||
echo "Stopping Pandora FMS Network Server"
|
||||
kill $PANDORA_PID > /dev/null 2>&1
|
||||
rm -f $PANDORA_PID
|
||||
fi
|
||||
;;
|
||||
force-reload|restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: pandora_network {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
|
|
|
@ -67,8 +67,8 @@ install () {
|
|||
}
|
||||
|
||||
uninstall () {
|
||||
if [ "`uname -s`" != "Linux" ]; then
|
||||
echo "This is not a Linux-based distro. Uninstaller is currently not working for your OS"
|
||||
if [ "`uname -s`" != "Linux" ]; then
|
||||
echo "This is not a Linux-based distro. Uninstaller is currently not working for your OS"
|
||||
fi
|
||||
echo "Removing Pandora Servers"
|
||||
rm -Rf /var/spool/pandora/data_in/
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Pandora FMS Plugin Server, startup script
|
||||
# Sancho Lerena, <slerena@gmail.com>
|
||||
# Copyright (c) 2006-2008 Sancho Lerena, <slerena@gmail.com>
|
||||
# Linux Version (generic)
|
||||
# 2.0 Build 080620
|
||||
# v2.0 Build 080903
|
||||
# http://www.pandorafms.com
|
||||
|
||||
# Configurable path and filenames
|
||||
PANDORA_HOME="/etc/pandora/pandora_server.conf"
|
||||
PANDORA_PID_PATH="/var/run"
|
||||
PANDORA_PID=$PANDORA_PID_PATH/pandora_plugin.pid
|
||||
PANDORA_DAEMON=/usr/bin/pandora_plugin
|
||||
PANDORA_DAEMON=/usr/local/bin/pandora_plugin
|
||||
|
||||
# Main script
|
||||
|
||||
|
@ -21,50 +22,50 @@ fi
|
|||
|
||||
if [ ! -f $PANDORA_DAEMON ]
|
||||
then
|
||||
echo "Pandora FMS Plugin Server not found, please check setup and read manual"
|
||||
exit
|
||||
echo "Pandora FMS Plugin 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 Plugin Server is currently running on this machine with PID ($PANDORA_PID). Aborting now..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$PANDORA_DAEMON $PANDORA_HOME -D
|
||||
sleep 1
|
||||
start)
|
||||
OLD_PATH="`pwd`"
|
||||
PANDORA_PID=$(pidof -x $PANDORA_DAEMON)
|
||||
if [ ! -z $PANDORA_PID ]
|
||||
then
|
||||
echo "Pandora FMS Plugin Server is currently running on this machine with PID ($PANDORA_PID). Aborting now..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PANDORA_PID=$(pidof -x $PANDORA_DAEMON)
|
||||
if [ ! -z "$PANDORA_PID" ]
|
||||
then
|
||||
echo "Pandora FMS Plugin Server is now running with PID $PANDORA_PID"
|
||||
else
|
||||
echo "Cannot start Pandora FMS Plugin Server. Aborted."
|
||||
fi
|
||||
cd "$OLD_PATH"
|
||||
;;
|
||||
stop)
|
||||
PANDORA_PID=$(pidof -x $PANDORA_DAEMON)
|
||||
if [ -z $PANDORA_PID ]
|
||||
then
|
||||
echo "Pandora FMS Plugin Server is not running, cannot stop it."
|
||||
exit 1
|
||||
else
|
||||
echo "Stopping Pandora FMS Plugin Server"
|
||||
kill $PANDORA_PID > /dev/null 2>&1
|
||||
rm -f $PANDORA_PID
|
||||
fi
|
||||
;;
|
||||
force-reload|restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: pandora_plugin {start|stop|restart}"
|
||||
exit 1
|
||||
$PANDORA_DAEMON $PANDORA_HOME -D
|
||||
sleep 1
|
||||
|
||||
PANDORA_PID=$(pidof -x $PANDORA_DAEMON)
|
||||
if [ ! -z "$PANDORA_PID" ]
|
||||
then
|
||||
echo "Pandora FMS Plugin Server is now running with PID $PANDORA_PID"
|
||||
else
|
||||
echo "Cannot start Pandora FMS Plugin Server. Aborted."
|
||||
fi
|
||||
cd "$OLD_PATH"
|
||||
;;
|
||||
stop)
|
||||
PANDORA_PID=$(pidof -x $PANDORA_DAEMON)
|
||||
if [ -z $PANDORA_PID ]
|
||||
then
|
||||
echo "Pandora FMS Plugin Server is not running, cannot stop it."
|
||||
exit 1
|
||||
else
|
||||
echo "Stopping Pandora FMS Plugin Server"
|
||||
kill $PANDORA_PID > /dev/null 2>&1
|
||||
rm -f $PANDORA_PID
|
||||
fi
|
||||
;;
|
||||
force-reload|restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: pandora_plugin {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Pandora FMS Prediction, startup script
|
||||
# Sancho Lerena, <slerena@gmail.com>
|
||||
# Pandora FMS Prediction Server, startup script
|
||||
# Copyright (c) 2006-2008 Sancho Lerena, <slerena@gmail.com>
|
||||
# Linux Version (generic)
|
||||
# v2.0 Build 0080513
|
||||
# v2.0 Build 080903
|
||||
# http://www.pandorafms.com
|
||||
|
||||
# Configurable path and filenames
|
||||
PANDORA_HOME="/etc/pandora/pandora_server.conf"
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Pandora FMS Recon Server, startup script
|
||||
# Sancho Lerena, <slerena@gmail.com>
|
||||
# Copyright (c) 2006-2008 Sancho Lerena, <slerena@gmail.com>
|
||||
# Linux Version (generic)
|
||||
# v1.3 Build 070731
|
||||
# v2.0 Build 080903
|
||||
# http://www.pandorafms.com
|
||||
|
||||
# Configurable path and filenames
|
||||
PANDORA_HOME="/etc/pandora/pandora_server.conf"
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Pandora Data Server, startup script
|
||||
# Sancho Lerena, <slerena@gmail.com>
|
||||
# Linux Version (generico)
|
||||
# v1.3 Build 070802
|
||||
# Pandora FMS Data Server, startup script
|
||||
# Copyright (c) 2006-2008 Sancho Lerena, <slerena@gmail.com>
|
||||
# Linux Version (generic)
|
||||
# v2.0 Build 080903
|
||||
# http://www.pandorafms.com
|
||||
|
||||
# Configurable path and filenames
|
||||
PANDORA_HOME="/etc/pandora/pandora_server.conf"
|
||||
|
@ -21,8 +22,8 @@ fi
|
|||
|
||||
if [ ! -f $PANDORA_DAEMON ]
|
||||
then
|
||||
echo "Pandora FMS Data Server not found, please check setup and read manual"
|
||||
exit
|
||||
echo "Pandora FMS Data Server not found, please check setup and read manual"
|
||||
exit
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
|
@ -48,25 +49,25 @@ case "$1" in
|
|||
echo "Cannot start Pandora FMS Data Server. Aborted."
|
||||
fi
|
||||
cd "$OLD_PATH"
|
||||
;;
|
||||
;;
|
||||
stop)
|
||||
PANDORA_PID=$(pidof -x $PANDORA_DAEMON)
|
||||
if [ -z $PANDORA_PID ]
|
||||
then
|
||||
echo "Pandora FMS Data Server is not running, cannot stop it."
|
||||
exit 1
|
||||
echo "Pandora FMS Data Server is not running, cannot stop it."
|
||||
exit 1
|
||||
else
|
||||
echo "Stopping Pandora FMS Data Server"
|
||||
kill $PANDORA_PID > /dev/null 2>&1
|
||||
rm -f $PANDORA_PID
|
||||
echo "Stopping Pandora FMS Data Server"
|
||||
kill $PANDORA_PID > /dev/null 2>&1
|
||||
rm -f $PANDORA_PID
|
||||
fi
|
||||
;;
|
||||
;;
|
||||
force-reload|restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: pandora_server {start|stop|restart}"
|
||||
exit 1
|
||||
echo "Usage: pandora_server {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
#
|
||||
# Pandora Server
|
||||
# Pandora FMS Server
|
||||
#
|
||||
%define name pandora_server
|
||||
%define version 1.3.1
|
||||
Summary: Pandora Server
|
||||
%define version 2.0.0
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
Version: %{version}
|
||||
Release: 1
|
||||
License: GPL
|
||||
Vendor: Sancho Lerena <sancho.lerena@artica.es>
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
URL: http://pandora.sf.net
|
||||
URL: http://www.pandorafms.com
|
||||
Group: System/Monitoring
|
||||
Packager: Manuel Arostegui <marostegui@artica.es>
|
||||
Prefix: /usr/share
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# (c) 2008 Manuel Arostegui <marostegui@artica.es>
|
||||
# Pandora FMS 2.0 Server Installer (c) 2008 Manuel Arostegui <marostegui@artica.es>
|
||||
# Please see http://pandora.sourceforge.net
|
||||
# This code is licensed under GPL 2.0 license.
|
||||
# **********************************************************************
|
||||
|
@ -19,7 +19,7 @@ then
|
|||
echo "You are missing the following dependencies"
|
||||
echo " "
|
||||
cat output | awk -F ": prerequisite" '{print $2}' | awk -F " " '{print $1}'
|
||||
echo "The complete installation guide is at: "http://www.openideas.info/wiki/index.php?title=Pandora_1.3:Server:QIG#Installing_from_sources" "
|
||||
echo "The complete installation guide is at: "http://www.openideas.info/wiki/index.php?title=Pandora_2.0:Documentation_en:Install_Server#Pandora_FMS_Server_installation" "
|
||||
echo " "
|
||||
echo "Debian-based distribution do:"
|
||||
echo " $ apt-get install libdate-manip-perl snmp snmpd libsnmp-perl libtime-format-perl libxml-simple-perl libnetaddr-ip-perl libdbi-perl libxml-simple-perl libnetaddr-ip-perl libhtml-parser-perl wmi-client xprobe2"
|
||||
|
@ -78,9 +78,9 @@ else
|
|||
if [ -e /usr/local/bin/pandora_server ]
|
||||
then
|
||||
ln -s /usr/local/bin/pandora_server /usr/bin/pandora_server
|
||||
ln -s /usr/local/bin/pandora_snmpconsole /usr/bin/pandora_snmpconsole
|
||||
ln -s /usr/local/bin/pandora_recon /usr/bin/pandora_recon
|
||||
ln -s /usr/local/bin/pandora_network /usr/bin/pandora_network
|
||||
ln -s /usr/local/bin/pandora_snmpconsole /usr/bin/pandora_snmpconsole
|
||||
ln -s /usr/local/bin/pandora_recon /usr/bin/pandora_recon
|
||||
ln -s /usr/local/bin/pandora_network /usr/bin/pandora_network
|
||||
ln -s /usr/local/bin/pandora_prediction /usr/bin/pandora_prediction
|
||||
ln -s /usr/local/bin/pandora_plugin /usr/bin/pandora_plugin
|
||||
ln -s /usr/local/bin/pandora_wmi /usr/bin/pandora_wmi
|
||||
|
@ -111,11 +111,11 @@ fi
|
|||
}
|
||||
|
||||
uninstall () {
|
||||
if [ "`uname -s`" != "Linux" ]; then
|
||||
echo "This is not a Linux-based distro. Uninstaller is currently not working for your OS"
|
||||
if [ "`uname -s`" != "Linux" ]; then
|
||||
echo "This is not a Linux-based distro. Uninstaller is currently not working for your OS"
|
||||
fi
|
||||
echo "Removing Pandora Servers"
|
||||
rm -Rf /var/spool/pandora/data_in/
|
||||
rm -Rf /var/spool/pandora/data_in/
|
||||
|
||||
echo "If the user Pandora is not being used for any other operations, please delete using the following commands:"
|
||||
echo " userdel pandora"
|
||||
|
@ -124,31 +124,30 @@ uninstall () {
|
|||
## I would hate to have a script clear out this users' information without any notification
|
||||
|
||||
rm -Rf /var/log/pandora/ 2> /dev/null
|
||||
rm -Rf /etc/pandora/pandora_server.conf 2> /dev/null
|
||||
|
||||
rm -Rf /etc/init.d/pandora_server 2> /dev/null
|
||||
rm -Rf /etc/pandora/pandora_server.conf 2> /dev/null
|
||||
rm -Rf /etc/init.d/pandora_server 2> /dev/null
|
||||
rm -Rf /etc/init.d/pandora_network 2> /dev/null
|
||||
rm -Rf /etc/init.d/pandora_recon 2> /dev/null
|
||||
rm -Rf /etc/init.d/pandora_recon 2> /dev/null
|
||||
rm -Rf /etc/init.d/pandora_snmpconsole 2> /dev/null
|
||||
rm -Rf /etc/init.d/pandora_prediction 2> /dev/null
|
||||
rm -Rf /etc/init.d/pandora_wmi 2> /dev/null
|
||||
rm -Rf /etc/init.d/pandora_plugin 2> /dev/null
|
||||
rm -Rf /etc/init.d/pandora_plugin 2> /dev/null
|
||||
|
||||
rm -Rf /etc/rc2.d/S90pandora_server 2> /dev/null
|
||||
rm -Rf /etc/rc2.d/S90pandora_recon 2> /dev/null
|
||||
rm -Rf /etc/rc2.d/S90pandora_recon 2> /dev/null
|
||||
rm -Rf /etc/rc2.d/S90pandora_network 2> /dev/null
|
||||
rm -Rf /etc/rc2.d/S90pandora_snmpconsole 2> /dev/null
|
||||
rm -Rf /etc/rc2.d/S90pandora_wmi 2> /dev/null
|
||||
rm -Rf /etc/rc2.d/S90pandora_prediction 2> /dev/null
|
||||
rm -Rf /etc/rc2.d/S90pandora_plugin 2> /dev/null
|
||||
rm -Rf /etc/rc2.d/S90pandora_wmi 2> /dev/null
|
||||
rm -Rf /etc/rc2.d/S90pandora_prediction 2> /dev/null
|
||||
rm -Rf /etc/rc2.d/S90pandora_plugin 2> /dev/null
|
||||
|
||||
rm -Rf /usr/local/bin/pandora_server 2> /dev/null
|
||||
rm -Rf /usr/local/bin/pandora_snmpconsole 2> /dev/null
|
||||
rm -Rf /usr/local/bin/pandora_recon 2> /dev/null
|
||||
rm -Rf /usr/local/bin/pandora_network 2> /dev/null
|
||||
rm -Rf /usr/local/bin/pandora_wmi 2> /dev/null
|
||||
rm -Rf /usr/local/bin/pandora_prediction 2> /dev/null
|
||||
rm -Rf /usr/local/bin/pandora_plugin 2> /dev/null
|
||||
rm -Rf /usr/local/bin/pandora_wmi 2> /dev/null
|
||||
rm -Rf /usr/local/bin/pandora_prediction 2> /dev/null
|
||||
rm -Rf /usr/local/bin/pandora_plugin 2> /dev/null
|
||||
|
||||
rm -Rf /usr/bin/pandora_wmi 2> /dev/null
|
||||
rm -Rf /usr/bin/pandora_server 2> /dev/null
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Startup script for Pandora SNMP Console
|
||||
# Sancho Lerena, <slerena@gmail.com>
|
||||
# Pandora FMS SNMP Console, startup script
|
||||
# Copyright (c) 2006-2008 Sancho Lerena, <slerena@gmail.com>
|
||||
# Linux Version (generic)
|
||||
# v1.3 BUILD 070802
|
||||
# v2.0 Build 080903
|
||||
# http://www.pandorafms.com
|
||||
|
||||
# Compatible with NetSNMP 5.1 or higher
|
||||
|
||||
|
@ -17,35 +18,36 @@ DAEMON_LOG="/var/log/pandora/pandora_snmptrap.log"
|
|||
DAEMON_PID="$PANDORA_PID_PATH/pandora_snmptrapd.pid"
|
||||
DAEMON_PATH=/usr/sbin/snmptrapd
|
||||
|
||||
# Dont touch this call unless you know are doing. For different versions of NetSNMP Trap daemon, it's possible you need to change some options
|
||||
# Dont touch this call unless you know are doing.
|
||||
# For different versions of NetSNMP Trap daemon, it's possible you need to change some options
|
||||
# Please refer NetSNMP documentation in that case.
|
||||
DAEMON_OPTIONS="-t -On -n -a -Lf $DAEMON_LOG -p $DAEMON_PID -F %4y-%02.2m-%l[**]%02.2h:%02.2j:%02.2k[**]%a[**]%N[**]%w[**]%W[**]%q[**]%v\n"
|
||||
DAEMON="$DAEMON_PATH $DAEMON_OPTIONS"
|
||||
|
||||
if [ ! -d "$PANDORA_PID_PATH" ]
|
||||
then
|
||||
echo "Pandora FMS cannot write it's PID file in $PANDORA_PID_PATH. Please create that directory"
|
||||
exit
|
||||
echo "Pandora FMS cannot write it's PID file in $PANDORA_PID_PATH. Please create that directory"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ ! -f "$DAEMON_PATH" ]
|
||||
then
|
||||
echo "NetSNMP snmptrapd not found at $DAEMON_PATH, please check setup and read manual"
|
||||
exit
|
||||
echo "NetSNMP snmptrapd not found at $DAEMON_PATH, please check setup and read manual"
|
||||
exit
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
if [ -f $DAEMON_PID ]
|
||||
then
|
||||
start)
|
||||
if [ -f $DAEMON_PID ]
|
||||
then
|
||||
CHECK_PID=`cat $DAEMON_PID`
|
||||
CHECK_PID_RESULT=`ps aux | grep -v grep | grep "$CHECK_PID" | grep "snmp" | wc -l`
|
||||
if [ $CHECK_PID_RESULT == 1 ]
|
||||
then
|
||||
echo "NetSNMP Trap daemon is currently running on this machine with PID ($CHECK_PID). Aborting now..."
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
CHECK_PID_RESULT=`ps aux | grep -v grep | grep "$CHECK_PID" | grep "snmp" | wc -l`
|
||||
if [ $CHECK_PID_RESULT == 1 ]
|
||||
then
|
||||
echo "NetSNMP Trap daemon is currently running on this machine with PID ($CHECK_PID). Aborting now..."
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
|
||||
SNMP_WARNING=`ps aux | grep "$DAEMON_PATH" | grep -v grep | wc -l`
|
||||
if [ $SNMP_WARNING == 1 ]
|
||||
|
@ -81,22 +83,22 @@ case "$1" in
|
|||
RESULT="`cat $DAEMON_LOG | grep 'errno 13' 2> /dev/null`"
|
||||
if [ -z "$RESULT" ]
|
||||
then
|
||||
echo "NetSNMP Trap daemon is now running with PID `cat $DAEMON_PID 2> /dev/null`"
|
||||
echo "NetSNMP Trap daemon is now running with PID `cat $DAEMON_PID 2> /dev/null`"
|
||||
else
|
||||
echo "NetSNMP cannot open port (udp/162). Please execute as root user"
|
||||
rm -f $DAEMON_PID 2> /dev/null
|
||||
fi
|
||||
|
||||
if [ -f $PANDORA_PID ]
|
||||
then
|
||||
CHECK_PID=`cat $PANDORA_PID`
|
||||
CHECK_PID_RESULT=`ps aux | grep -v grep | grep "$CHECK_PID" | grep "pandora_snmpconsole" | wc -l`
|
||||
if [ $CHECK_PID_RESULT == 1 ]
|
||||
then
|
||||
echo "Pandora FMS SNMP Server is currently running on this machine with PID ($CHECK_PID). Aborting now..."
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
then
|
||||
CHECK_PID=`cat $PANDORA_PID`
|
||||
CHECK_PID_RESULT=`ps aux | grep -v grep | grep "$CHECK_PID" | grep "pandora_snmpconsole" | wc -l`
|
||||
if [ $CHECK_PID_RESULT == 1 ]
|
||||
then
|
||||
echo "Pandora FMS SNMP Server is currently running on this machine with PID ($CHECK_PID). Aborting now..."
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
|
||||
$PANDORA_DAEMON $PANDORA_HOME -D
|
||||
sleep 1
|
||||
|
@ -111,40 +113,40 @@ case "$1" in
|
|||
fi
|
||||
cd "$OLD_PATH"
|
||||
;;
|
||||
stop)
|
||||
if [ -f $DAEMON_PID ]
|
||||
then
|
||||
echo "Stopping NetSNMP Trap daemon"
|
||||
PID_1=`cat $DAEMON_PID`
|
||||
if [ ! -z "`ps -F -p $PID_1 | grep -v grep | grep 'snmptrapd'`" ]
|
||||
then
|
||||
kill -9 `cat $DAEMON_PID 2> /dev/null`
|
||||
fi
|
||||
rm -f $DAEMON_PID 2> /dev/null > /dev/null
|
||||
rm -f $DAEMON_LOG 2> /dev/null > /dev/null
|
||||
else
|
||||
echo "NetSNMP Trap daemon is not running, cannot stop it."
|
||||
fi
|
||||
stop)
|
||||
if [ -f $DAEMON_PID ]
|
||||
then
|
||||
echo "Stopping NetSNMP Trap daemon"
|
||||
PID_1=`cat $DAEMON_PID`
|
||||
if [ ! -z "`ps -F -p $PID_1 | grep -v grep | grep 'snmptrapd'`" ]
|
||||
then
|
||||
kill -9 `cat $DAEMON_PID 2> /dev/null`
|
||||
fi
|
||||
rm -f $DAEMON_PID 2> /dev/null > /dev/null
|
||||
rm -f $DAEMON_LOG 2> /dev/null > /dev/null
|
||||
else
|
||||
echo "NetSNMP Trap daemon is not running, cannot stop it."
|
||||
fi
|
||||
|
||||
if [ -f $PANDORA_PID ]
|
||||
then
|
||||
echo "Stopping Pandora SNMP Console"
|
||||
PID_2=`cat $PANDORA_PID`
|
||||
if [ ! -z "`ps -F -p $PID_2 | grep -v grep | grep 'pandora_snmpconsole'`" ]
|
||||
then
|
||||
kill `cat $PANDORA_PID` 2> /dev/null > /dev/null
|
||||
fi
|
||||
rm -f $PANDORA_PID
|
||||
echo "Stopping Pandora SNMP Console"
|
||||
PID_2=`cat $PANDORA_PID`
|
||||
if [ ! -z "`ps -F -p $PID_2 | grep -v grep | grep 'pandora_snmpconsole'`" ]
|
||||
then
|
||||
kill `cat $PANDORA_PID` 2> /dev/null > /dev/null
|
||||
fi
|
||||
rm -f $PANDORA_PID
|
||||
else
|
||||
echo "Pandora FMS SNMP Console is not running, cannot stop it."
|
||||
echo "Pandora FMS SNMP Console is not running, cannot stop it."
|
||||
fi
|
||||
;;
|
||||
force-reload|restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: pandora_snmpconsole {start|stop|restart}"
|
||||
exit 1
|
||||
;;
|
||||
force-reload|restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: pandora_snmpconsole {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Pandora FMS WMI Server, startup script
|
||||
# Sancho Lerena, <slerena@gmail.com>
|
||||
# Copyright (c) 2006-2008 Sancho Lerena, <slerena@gmail.com>
|
||||
# Linux Version (generic)
|
||||
# 2.0 Build 080620
|
||||
# v2.0 Build 080903
|
||||
# http://www.pandorafms.com
|
||||
|
||||
# Configurable path and filenames
|
||||
PANDORA_HOME="/etc/pandora/pandora_server.conf"
|
||||
PANDORA_PID_PATH="/var/run"
|
||||
PANDORA_PID=$PANDORA_PID_PATH/pandora_wmi.pid
|
||||
PANDORA_DAEMON=/usr/bin/pandora_wmi
|
||||
PANDORA_DAEMON=/usr/local/bin/pandora_wmi
|
||||
|
||||
# Main script
|
||||
|
||||
|
@ -21,50 +22,50 @@ fi
|
|||
|
||||
if [ ! -f $PANDORA_DAEMON ]
|
||||
then
|
||||
echo "Pandora FMS WMI Server not found, please check setup and read manual"
|
||||
exit
|
||||
echo "Pandora FMS WMI 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 WMI Server is currently running on this machine with PID ($PANDORA_PID). Aborting now..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$PANDORA_DAEMON $PANDORA_HOME -D
|
||||
sleep 1
|
||||
start)
|
||||
OLD_PATH="`pwd`"
|
||||
PANDORA_PID=$(pidof -x $PANDORA_DAEMON)
|
||||
if [ ! -z $PANDORA_PID ]
|
||||
then
|
||||
echo "Pandora FMS WMI Server is currently running on this machine with PID ($PANDORA_PID). Aborting now..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PANDORA_PID=$(pidof -x $PANDORA_DAEMON)
|
||||
if [ ! -z "$PANDORA_PID" ]
|
||||
then
|
||||
echo "Pandora FMS WMI Server is now running with PID $PANDORA_PID"
|
||||
else
|
||||
echo "Cannot start Pandora FMS WMI Server. Aborted."
|
||||
fi
|
||||
cd "$OLD_PATH"
|
||||
;;
|
||||
stop)
|
||||
PANDORA_PID=$(pidof -x $PANDORA_DAEMON)
|
||||
if [ -z $PANDORA_PID ]
|
||||
then
|
||||
echo "Pandora FMS WMI Server is not running, cannot stop it."
|
||||
exit 1
|
||||
else
|
||||
echo "Stopping Pandora FMS WMI Server"
|
||||
kill $PANDORA_PID > /dev/null 2>&1
|
||||
rm -f $PANDORA_PID
|
||||
fi
|
||||
;;
|
||||
force-reload|restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: pandora_plugin {start|stop|restart}"
|
||||
exit 1
|
||||
$PANDORA_DAEMON $PANDORA_HOME -D
|
||||
sleep 1
|
||||
|
||||
PANDORA_PID=$(pidof -x $PANDORA_DAEMON)
|
||||
if [ ! -z "$PANDORA_PID" ]
|
||||
then
|
||||
echo "Pandora FMS WMI Server is now running with PID $PANDORA_PID"
|
||||
else
|
||||
echo "Cannot start Pandora FMS WMI Server. Aborted."
|
||||
fi
|
||||
cd "$OLD_PATH"
|
||||
;;
|
||||
stop)
|
||||
PANDORA_PID=$(pidof -x $PANDORA_DAEMON)
|
||||
if [ -z $PANDORA_PID ]
|
||||
then
|
||||
echo "Pandora FMS WMI Server is not running, cannot stop it."
|
||||
exit 1
|
||||
else
|
||||
echo "Stopping Pandora FMS WMI Server"
|
||||
kill $PANDORA_PID > /dev/null 2>&1
|
||||
rm -f $PANDORA_PID
|
||||
fi
|
||||
;;
|
||||
force-reload|restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: pandora_plugin {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
|
|
Loading…
Reference in New Issue