- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - Linux
- >
- General
- >
- Shown Invalid Service Status Value in Nagios netwo...
-
- Forums
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Blogs
-
Information
-
English
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- Report Inappropriate Content
04-21-2007 12:30 AM
04-21-2007 12:30 AM
Re: Shown Invalid Service Status Value in Nagios network application
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2021 Hewlett Packard Enterprise Development LP