The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Special Forums > Security
.
google unix.com



Security Discuss UNIX and Linux computer and network security, cybersecurity, cyberattacks, IT security, CISSP, OWASP and more.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
using a variable from java program in unix inquisitive101 UNIX for Dummies Questions & Answers 1 01-14-2009 09:24 AM
On relationships among: derived event, composite event, complex event and situation iBot Complex Event Processing RSS News 0 07-17-2008 06:50 AM
how can i run java program from any where umen Shell Programming and Scripting 1 06-12-2006 09:36 PM
executing the su command from a java program. shailendrat UNIX for Dummies Questions & Answers 1 03-24-2005 12:27 PM
Communication between a java and c++ program lmnt22 High Level Programming 4 11-13-2001 04:24 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-09-2009
mzahmed mzahmed is offline
Registered User
  
 

Join Date: Mar 2009
Posts: 1
Nagios + Event Handler + Java program

Hi,

I am trying to start a java program from nagios event handler at CRITICAL + SOFT + 3 or CRITICAL + HARD status.


My Observations:
I used the echo command in mytest.sh and am getting the result in the nagios.debug log file.
But when I am running the java command in mytest.sh script that java program is not executing on port 7000.
I double checked on the permission and everything look good to me.



Following is my configuration status.

Nagios 3.0.7

JDK 1.5.0_07

define service {
service_description MY_XYZ_SERVICE
name MyxyzService
use tcp-service
contact_groups Admins
check_command check_tcp!7000
event_handler restart_xyz
hostgroup_name appservers
}



define command{
command_name restart_xyz
command_line /home/test/test1.sh $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$
}


test1.sh
---------

#!/bin/sh

case "$1" in
OK)
;;
WARNING)
;;
UNKNOWN)
;;
CRITICAL)
SOFT)
case "$3" in
3)
echo -n "Restarting Myxyz service (3rd soft critical state)..."
/home/xyz/mytest.sh
;;
esac
;;

HARD)
echo -n "Restarting Myxyz service..."
/home/xyz/mytest.sh
;;
esac
;;
esac
exit 0


mytest.sh
-----------


#!/bin/bash

# echo "hello world This works perfectly when I remove the comment but the below java command is not executed."

nohup java -Xrs com.test.xyz.MyXYZServer 7000 &
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:04 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0