- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Nagios + Event Handler + Java program
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2009 08:13 AM
тАО03-09-2009 08:13 AM
Nagios + Event Handler + Java program
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 &
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2009 08:49 AM
тАО03-09-2009 08:49 AM
Re: Nagios + Event Handler + Java program
"nohup java -Xrs com.test.xyz.MyXYZServer 7000 & "
what happens if you specify:
nohup
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2009 09:07 AM
тАО03-09-2009 09:07 AM
Re: Nagios + Event Handler + Java program
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2009 09:09 AM
тАО03-09-2009 09:09 AM
Re: Nagios + Event Handler + Java program
netstat -nlp | grep 7000
Doesn't show anything for port 7000
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2009 09:10 AM
тАО03-09-2009 09:10 AM