- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Shown Invalid Service Status Value in Nagios netwo...
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
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
тАО04-19-2007 09:14 PM
тАО04-19-2007 09:14 PM
Shown Invalid Service Status Value in Nagios network application
Iam using nagios network application when i trying to found service status value.But finally it shown invalid status value in nagios application. I wrote a code as mentioned below
#!/bin/sh
host="$1"
service="$2"
/etc/init.d/$service status | while read t
echo $t
do
if [[ "$t" == *running* ]]
then
echo "Service is running "
else
echo "Service is stopped"
fi
done
But as mentioned above code running in command prompt on fedora linux,it shown a correct service status value.But when i trying from nagios.It shows a invalid status value.
If any plugins for checking a service status value or any modification. Please suggest to me on this issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2007 09:58 PM
тАО04-19-2007 09:58 PM
Re: Shown Invalid Service Status Value in Nagios network application
This minor edit seems 'safer' to me already:
t=$(service $2 status)
if [[ "$t" == *running* ]]
then
echo "Service is running "
else
echo "Service is stopped"
fi
G'luck !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2007 10:02 PM
тАО04-19-2007 10:02 PM
Re: Shown Invalid Service Status Value in Nagios network application
#!/bin/bash
host="$1"
service="$2"
t=$(/etc/init.d/$service status)
if [[ "$t" == *running* ]]
then
echo "Service is running "
else
echo "Service is stopped"
fi
Still quick 'n dirty, though..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2007 10:12 PM
тАО04-19-2007 10:12 PM
Re: Shown Invalid Service Status Value in Nagios network application
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-20-2007 01:00 AM
тАО04-20-2007 01:00 AM
Re: Shown Invalid Service Status Value in Nagios network application
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-20-2007 01:30 AM
тАО04-20-2007 01:30 AM
Re: Shown Invalid Service Status Value in Nagios network application
[root@orabox ~]# /etc/init.d/xinetd status
xinetd (pid 2660) is running...
[root@orabox ~]# su - user1
[user1@orabox ~]$ /etc/init.d/xinetd status
[user1@orabox ~]$
--> No output when running from the user account
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-20-2007 02:52 AM
тАО04-20-2007 02:52 AM
Re: Shown Invalid Service Status Value in Nagios network application
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-20-2007 05:16 AM
тАО04-20-2007 05:16 AM
Re: Shown Invalid Service Status Value in Nagios network application
nagios ALL=NOPASSWD:/etc/init.d/service1 status, /etc/init.d/service2 status
This way, nagios should be able to run the scripts as root, and only with the 'status' option.
Cheers,
Wout
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-20-2007 07:09 AM
тАО04-20-2007 07:09 AM
Re: Shown Invalid Service Status Value in Nagios network application
Welcome to the forums !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-21-2007 12:30 AM
тАО04-21-2007 12:30 AM