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 &
Nagios + Event Handler + Java program
Support for security such as Firewalls and securing linux
Return to “CentOS 4 - Security Support”
Jump to
- CentOS General Purpose
- ↳ CentOS - FAQ & Readme First
- ↳ Announcements
- ↳ CentOS Social
- ↳ User Comments
- ↳ Website Problems
- CentOS 8
- ↳ CentOS 8 - General Support
- ↳ CentOS 8 - Hardware Support
- ↳ CentOS 8 - Networking Support
- ↳ CentOS 8 - Security Support
- CentOS 7
- ↳ CentOS 7 - General Support
- ↳ CentOS 7 - Software Support
- ↳ CentOS 7 - Hardware Support
- ↳ CentOS 7 - Networking Support
- ↳ CentOS 7 - Security Support
- CentOS 6
- ↳ CentOS 6 - General Support
- ↳ CentOS 6 - Software Support
- ↳ CentOS 6 - Hardware Support
- ↳ CentOS 6 - Networking Support
- ↳ CentOS 6 - Security Support
- CentOS Legacy Versions
- ↳ CentOS 4
- ↳ CentOS 4 - General Support
- ↳ CentOS 4 - Software Support
- ↳ CentOS 4 - Hardware Support
- ↳ CentOS 4 - Networking Support
- ↳ CentOS 4 - Server Support
- ↳ CentOS 4 - Security Support
- ↳ CentOS 4 - Webhosting Support
- ↳ CentOS 4 - X86_64,s390(x) and PowerPC Support
- ↳ CentOS 4 - Oracle Installation and Support
- ↳ CentOS 4 - Miscellaneous Questions
- ↳ CentOS 5
- ↳ CentOS 5 - General Support
- ↳ CentOS 5 - Software Support
- ↳ CentOS 5 - Hardware Support
- ↳ CentOS 5 - Networking Support
- ↳ CentOS 5 - Server Support
- ↳ CentOS 5 - Security Support
- ↳ CentOS 5 - Webhosting Support
- ↳ CentOS 5 - X86_64,s390(x) and PowerPC Support
- ↳ CentOS 5 - Oracle Installation and Support
- ↳ CentOS 5 - Miscellaneous Questions