mirror of
				https://github.com/pandorafms/pandorafms.git
				synced 2025-10-31 11:34:51 +01:00 
			
		
		
		
	2009-07-30 Manuel Arostegui <manuel@todo-linux.com>
* SLES10/pandora_wmi, pandora_plugin, pandora_prediction
        pandora_snmpconsole, pandora_recon, pandora_server
        pandora_network: Deleted from repository. We don't need these 
         scripts anymore.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1825 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
			
			
This commit is contained in:
		
							parent
							
								
									6a3903d98e
								
							
						
					
					
						commit
						2f2abc143b
					
				| @ -1,3 +1,10 @@ | |||||||
|  | 2009-07-30  Manuel Arostegui  <manuel@todo-linux.com> | ||||||
|  | 
 | ||||||
|  | 	* SLES10/pandora_wmi, pandora_plugin, pandora_prediction | ||||||
|  | 	pandora_snmpconsole, pandora_recon, pandora_server | ||||||
|  | 	pandora_network: Deleted from repository. We don't need these | ||||||
|  | 	 scripts anymore. | ||||||
|  | 
 | ||||||
| 2009-07-24  Jorge Gonzalez  <jorgegonz@artica.es> | 2009-07-24  Jorge Gonzalez  <jorgegonz@artica.es> | ||||||
| 
 | 
 | ||||||
| 	* util/pandora_exec: added execution permision to plugin server. | 	* util/pandora_exec: added execution permision to plugin server. | ||||||
|  | |||||||
| @ -1,60 +0,0 @@ | |||||||
| #!/bin/bash  |  | ||||||
| 
 |  | ||||||
| # Pandora FMS Network Server, startup script |  | ||||||
| # Sancho Lerena, <slerena@gmail.com> |  | ||||||
| # SLES 10 Version  |  | ||||||
| # v2.0 Build 081111 |  | ||||||
| 
 |  | ||||||
| # Configurable path and filenames |  | ||||||
| PANDORA_HOME="/etc/pandora/pandora_server.conf" |  | ||||||
| PANDORA_DAEMON=/usr/local/bin/pandora_network |  | ||||||
| 
 |  | ||||||
| # Main script |  | ||||||
| 
 |  | ||||||
| if [ ! -f $PANDORA_DAEMON ] |  | ||||||
| then |  | ||||||
|         echo "Pandora FMS Network Server not found, please check setup and read manual" |  | ||||||
|         exit |  | ||||||
| fi |  | ||||||
| 
 |  | ||||||
| case "$1" in |  | ||||||
|   start) |  | ||||||
| 	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 |  | ||||||
| 	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 |  | ||||||
|         ;; |  | ||||||
|   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  |  | ||||||
| 	fi |  | ||||||
|         ;; |  | ||||||
|   force-reload|restart) |  | ||||||
|         $0 stop |  | ||||||
| 	sleep 10 |  | ||||||
|         $0 start |  | ||||||
|         ;; |  | ||||||
|   *) |  | ||||||
|         echo "Usage: pandora_network {start|stop|restart}" |  | ||||||
|         exit 1 |  | ||||||
| esac |  | ||||||
| 
 |  | ||||||
| @ -1,60 +0,0 @@ | |||||||
| #!/bin/bash  |  | ||||||
| 
 |  | ||||||
| # Pandora FMS Plugin Server, startup script |  | ||||||
| # Sancho Lerena, <slerena@gmail.com> |  | ||||||
| # SLES 10  |  | ||||||
| # v2.0 Build 081111 |  | ||||||
| 
 |  | ||||||
| # Configurable path and filenames |  | ||||||
| PANDORA_HOME="/etc/pandora/pandora_server.conf" |  | ||||||
| PANDORA_DAEMON=/usr/bin/pandora_plugin |  | ||||||
| 
 |  | ||||||
| # Main script |  | ||||||
| 
 |  | ||||||
| if [ ! -f $PANDORA_DAEMON ] |  | ||||||
| then |  | ||||||
|         echo "Pandora FMS Plugin Server not found, please check setup and read manual" |  | ||||||
|         exit |  | ||||||
| fi |  | ||||||
| 
 |  | ||||||
| case "$1" in |  | ||||||
|   start) |  | ||||||
| 	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 |  | ||||||
| 
 |  | ||||||
| 	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 |  | ||||||
|         ;; |  | ||||||
|   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  |  | ||||||
| 	fi |  | ||||||
|         ;; |  | ||||||
|   force-reload|restart) |  | ||||||
|         $0 stop |  | ||||||
| 	sleep 10 |  | ||||||
|         $0 start |  | ||||||
|         ;; |  | ||||||
|   *) |  | ||||||
|         echo "Usage: pandora_network {start|stop|restart}" |  | ||||||
|         exit 1 |  | ||||||
| esac |  | ||||||
| 
 |  | ||||||
| @ -1,61 +0,0 @@ | |||||||
| #!/bin/bash  |  | ||||||
| 
 |  | ||||||
| # Pandora FMS Prediction Server, startup script |  | ||||||
| # Sancho Lerena, <slerena@gmail.com> |  | ||||||
| # SLES 10 |  | ||||||
| # v2.0 build 081111 |  | ||||||
| 
 |  | ||||||
| # Configurable path and filenames |  | ||||||
| PANDORA_HOME="/etc/pandora/pandora_server.conf" |  | ||||||
| PANDORA_DAEMON=/usr/bin/pandora_prediction |  | ||||||
| 
 |  | ||||||
| # Main script |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| if [ ! -f $PANDORA_DAEMON ] |  | ||||||
| then |  | ||||||
|         echo "Pandora FMS Prediction Server not found, please check setup and read manual" |  | ||||||
|         exit |  | ||||||
| fi |  | ||||||
| 
 |  | ||||||
| case "$1" in |  | ||||||
|   start) |  | ||||||
| 	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 |  | ||||||
| 	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 |  | ||||||
|         ;; |  | ||||||
|   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  |  | ||||||
| 	fi |  | ||||||
|         ;; |  | ||||||
|   force-reload|restart) |  | ||||||
|         $0 stop |  | ||||||
| 	sleep 10 |  | ||||||
|         $0 start |  | ||||||
|         ;; |  | ||||||
|   *) |  | ||||||
|         echo "Usage: pandora_prediction {start|stop|restart}" |  | ||||||
|         exit 1 |  | ||||||
| esac |  | ||||||
| 
 |  | ||||||
| @ -1,60 +0,0 @@ | |||||||
| #!/bin/bash |  | ||||||
| 
 |  | ||||||
| # Pandora FMS Recon Server, startup script |  | ||||||
| # Sancho Lerena, <slerena@gmail.com> |  | ||||||
| # SLES Version  |  | ||||||
| # v2.0 build 081111 |  | ||||||
| 
 |  | ||||||
| # Configurable path and filenames |  | ||||||
| PANDORA_HOME="/etc/pandora/pandora_server.conf" |  | ||||||
| PANDORA_DAEMON=/usr/local/bin/pandora_recon |  | ||||||
| 
 |  | ||||||
| # Main script |  | ||||||
| 
 |  | ||||||
| if [ ! -f $PANDORA_DAEMON ]  |  | ||||||
| then |  | ||||||
|         echo "Pandora FMS Recon Server not found, please check setup and read manual" |  | ||||||
|         exit |  | ||||||
| fi |  | ||||||
| 
 |  | ||||||
| case "$1" in |  | ||||||
|   start) |  | ||||||
| 	PANDORA_PID=$(pidof -x $PANDORA_DAEMON) |  | ||||||
|         if [ ! -z $PANDORA_PID ] |  | ||||||
| 	then |  | ||||||
| 		echo "Pandora FMS Recon Server is currently running on this machine with PID ($PANDORA_PID). Aborting now..." |  | ||||||
| 		exit 1 |  | ||||||
| 	fi |  | ||||||
| 	 |  | ||||||
| 	$PANDORA_DAEMON $PANDORA_HOME -D |  | ||||||
| 	sleep 1 |  | ||||||
| 
 |  | ||||||
| 	PANDORA_PID=$(pidof -x $PANDORA_DAEMON) |  | ||||||
|         if [ ! -z "$PANDORA_PID" ] |  | ||||||
| 	then |  | ||||||
| 		echo "Pandora Recon Server is now running with PID $PANDORA_PID" |  | ||||||
| 	else |  | ||||||
| 		echo "Cannot start Pandora FMS Recon Server. Aborted." |  | ||||||
| 	fi |  | ||||||
|         ;; |  | ||||||
|   stop) |  | ||||||
| 	PANDORA_PID=$(pidof -x $PANDORA_DAEMON) |  | ||||||
|         if [ -z $PANDORA_PID ] |  | ||||||
| 	then |  | ||||||
| 		echo "Pandora FMS Recon Server is not running, cannot stop it." |  | ||||||
| 		exit 1	 |  | ||||||
| 	else |  | ||||||
| 	   	echo "Stopping Pandora FMS Recon Server" |  | ||||||
|            	kill $PANDORA_PID > /dev/null 2>&1 |  | ||||||
| 	fi |  | ||||||
|         ;; |  | ||||||
|   force-reload|restart) |  | ||||||
|         $0 stop |  | ||||||
| 	sleep 10 |  | ||||||
|         $0 start |  | ||||||
|         ;; |  | ||||||
|   *) |  | ||||||
|         echo "Usage: pandora_recon {start|stop|restart}" |  | ||||||
|         exit 1 |  | ||||||
| esac |  | ||||||
| 
 |  | ||||||
| @ -1,59 +0,0 @@ | |||||||
| #!/bin/bash  |  | ||||||
| 
 |  | ||||||
| # Pandora FMS Data Server, startup script |  | ||||||
| # Sancho Lerena, <slerena@gmail.com> |  | ||||||
| # SLES 10 version |  | ||||||
| # v2.0 build 081111 |  | ||||||
| 
 |  | ||||||
| # Configurable path and filenames |  | ||||||
| PANDORA_HOME="/etc/pandora/pandora_server.conf" |  | ||||||
| PANDORA_DAEMON=/usr/bin/pandora_server        |  | ||||||
| # Main script |  | ||||||
| 
 |  | ||||||
| if [ ! -f $PANDORA_DAEMON ] |  | ||||||
| then |  | ||||||
|         echo "Pandora FMS Data Server not found, please check setup and read manual" |  | ||||||
|         exit |  | ||||||
| fi |  | ||||||
| 
 |  | ||||||
| case "$1" in |  | ||||||
|   start) |  | ||||||
| 	PANDORA_PID=$(pidof -x $PANDORA_DAEMON) |  | ||||||
| 	if [ ! -z $PANDORA_PID ] |  | ||||||
| 	then |  | ||||||
| 		echo "Pandora FMS Data Server is currently running on this machine with PID ($PANDORA_PID). Aborting now..." |  | ||||||
| 		exit 1	 |  | ||||||
| 	fi |  | ||||||
| 	 |  | ||||||
| 	$PANDORA_DAEMON $PANDORA_HOME -D |  | ||||||
| 	sleep 1 |  | ||||||
| 
 |  | ||||||
| 	PANDORA_PID=$(pidof -x $PANDORA_DAEMON) |  | ||||||
| 	if [ ! -z "$PANDORA_PID" ] |  | ||||||
| 	then |  | ||||||
| 		echo "Pandora FMS Data Server is now running with PID $PANDORA_PID" |  | ||||||
| 	else |  | ||||||
| 		echo "Cannot start Pandora FMS Data Server. Aborted." |  | ||||||
| 	fi |  | ||||||
|         ;; |  | ||||||
|   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 |  | ||||||
| 	else |  | ||||||
| 	   echo "Stopping Pandora FMS Data Server" |  | ||||||
|            kill $PANDORA_PID > /dev/null 2>&1 |  | ||||||
| 	fi |  | ||||||
|         ;; |  | ||||||
|   force-reload|restart) |  | ||||||
|         $0 stop |  | ||||||
| 	sleep 10 |  | ||||||
|         $0 start |  | ||||||
|         ;; |  | ||||||
|   *) |  | ||||||
|         echo "Usage: pandora_server {start|stop|restart}" |  | ||||||
|         exit 1 |  | ||||||
| esac |  | ||||||
| 
 |  | ||||||
| @ -1,151 +0,0 @@ | |||||||
| #!/bin/bash |  | ||||||
| 
 |  | ||||||
| # Startup script for Pandora SNMP Console |  | ||||||
| # Sancho Lerena, <slerena@gmail.com> |  | ||||||
| # SLES 10 Version |  | ||||||
| # v2.0 build 081111 |  | ||||||
| 
 |  | ||||||
| # Compatible with NetSNMP 5.1 or higher |  | ||||||
| 
 |  | ||||||
| # Configurable path and filenames |  | ||||||
| PANDORA_HOME="/etc/pandora/pandora_server.conf" |  | ||||||
| PANDORA_PID_PATH="/var/run" |  | ||||||
| PANDORA_PID=$PANDORA_PID_PATH/pandora_snmp.pid |  | ||||||
| PANDORA_DAEMON=/usr/local/bin/pandora_snmpconsole |  | ||||||
| 
 |  | ||||||
| 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 |  | ||||||
| # 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 |  | ||||||
| fi |  | ||||||
| 
 |  | ||||||
| if [ ! -f "$DAEMON_PATH" ] |  | ||||||
| then |  | ||||||
|         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 |  | ||||||
| 		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 |  | ||||||
| 
 |  | ||||||
| 	SNMP_WARNING=`ps aux | grep "$DAEMON_PATH" | grep -v grep | wc -l` |  | ||||||
| 	if [ $SNMP_WARNING == 1 ] |  | ||||||
| 	then |  | ||||||
| 		echo "WARNING: Seems to be already running a SNMP trap daemon on this system not associated with Pandora FMS" |  | ||||||
| 		echo "Check manually if their output logfile is been used for Pandora FMS and it's format is correct" |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	# Launch SNMP TRAP Daemon |  | ||||||
| 	$DAEMON |  | ||||||
| 
 |  | ||||||
| 	sleep 1 |  | ||||||
| 	if [ ! -f $DAEMON_LOG ] |  | ||||||
|         then |  | ||||||
|                 echo "Problem with NetSNMP Trap daemon (Logfile $DAEMON_LOG not found!). Aborting" |  | ||||||
|                 exit |  | ||||||
|         fi |  | ||||||
| 
 |  | ||||||
| 	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 "Problem starting NetSNMP Trap daemon on this machine (PID File not correct). Aborting now..." |  | ||||||
|                         exit |  | ||||||
|                 fi |  | ||||||
| 	else |  | ||||||
| 		echo "Problem starting NetSNMP Trap daemon on this machine (Cannot get PID File). Aborting now..." |  | ||||||
|                 exit |  | ||||||
|         fi |  | ||||||
| 
 |  | ||||||
| 	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`" |  | ||||||
| 	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 |  | ||||||
| 
 |  | ||||||
| 	$PANDORA_DAEMON $PANDORA_HOME -D |  | ||||||
| 	sleep 1 |  | ||||||
| 
 |  | ||||||
| 	MYPID=`ps aux | grep "$PANDORA_DAEMON" | grep -v grep | tail -1 | awk '{print $2}'` |  | ||||||
| 	if [ ! -z "$MYPID" ] |  | ||||||
| 	then |  | ||||||
| 		echo $MYPID > $PANDORA_PID |  | ||||||
| 		echo "Pandora FMS SNMP Server is now running with PID $MYPID" |  | ||||||
| 	else |  | ||||||
| 		echo "Cannot start Pandora FMS SNMP Server. Aborted" |  | ||||||
| 	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 |  | ||||||
| 
 |  | ||||||
| 	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 |  | ||||||
| 	else |  | ||||||
| 	  echo "Pandora FMS SNMP Console is not running, cannot stop it." |  | ||||||
| 	fi |  | ||||||
|         ;; |  | ||||||
|   force-reload|restart) |  | ||||||
|         $0 stop |  | ||||||
| 	sleep 5 |  | ||||||
|         $0 start |  | ||||||
|         ;; |  | ||||||
|   *) |  | ||||||
|         echo "Usage: pandora_snmpconsole {start|stop|restart}" |  | ||||||
|         exit 1 |  | ||||||
| esac |  | ||||||
| 
 |  | ||||||
| @ -1,60 +0,0 @@ | |||||||
| #!/bin/bash  |  | ||||||
| 
 |  | ||||||
| # Pandora FMS WMI Server, startup script |  | ||||||
| # Sancho Lerena, <slerena@gmail.com> |  | ||||||
| # SLES 10 Version |  | ||||||
| # v2.0 Build 081111 |  | ||||||
| 
 |  | ||||||
| # Configurable path and filenames |  | ||||||
| PANDORA_HOME="/etc/pandora/pandora_server.conf" |  | ||||||
| PANDORA_DAEMON=/usr/bin/pandora_wmi |  | ||||||
| 
 |  | ||||||
| # Main script |  | ||||||
| 
 |  | ||||||
| if [ ! -f $PANDORA_DAEMON ] |  | ||||||
| then |  | ||||||
|         echo "Pandora FMS WMI Server not found, please check setup and read manual" |  | ||||||
|         exit |  | ||||||
| fi |  | ||||||
| 
 |  | ||||||
| case "$1" in |  | ||||||
|   start) |  | ||||||
| 	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 |  | ||||||
| 
 |  | ||||||
| 	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 |  | ||||||
|         ;; |  | ||||||
|   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  |  | ||||||
| 	fi |  | ||||||
|         ;; |  | ||||||
|   force-reload|restart) |  | ||||||
|         $0 stop |  | ||||||
| 	sleep 10 |  | ||||||
|         $0 start |  | ||||||
|         ;; |  | ||||||
|   *) |  | ||||||
|         echo "Usage: pandora_network {start|stop|restart}" |  | ||||||
|         exit 1 |  | ||||||
| esac |  | ||||||
| 
 |  | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user