LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 04-19-2007, 03:37 AM   #1
sureshkumar.repaka
LQ Newbie
 
Registered: Apr 2007
Posts: 5

Rep: Reputation: 0
Shown Invalid Service Status Value in Nagios network application


Hi all
Iam using nagios network application.when i trying to found status of service in network.It shown invalid status value in nagios application. I wrote a code as mentioned belw

Code:
#!/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
In runtime,it shown a correct service status value.But when i trying to use from nagios.It shows a invalid status value.

Please tell me any solution on this issue.

Last edited by sureshkumar.repaka; 04-19-2007 at 05:47 AM.
 
Old 04-19-2007, 05:34 AM   #2
makyo
Member
 
Registered: Aug 2006
Location: Saint Paul, MN, USA
Distribution: {Free,Open}BSD, CentOS, Debian, Fedora, Solaris, SuSE
Posts: 718

Rep: Reputation: 72
Hi.

I think you used the code from http://www.linuxquestions.org/questi...=1#post2717100 too literally -- at least the messages are a bit odd -- you check for keyword running, but provide messages for shell.

As I noted in the other thread, please use CODE blocks to display scripts and fragments -- select the text, then click the # symbol just above the editing window.

I cannot help you with the nagios aspect, but someone will likely stop by to advise you ... cheers, makyo
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nagios - Return code of 127 for check of service sriramsreedhar Linux - General 4 02-22-2014 03:54 PM
LXer: Complex service checks with Nagios LXer Syndicated Linux News 0 04-06-2007 07:02 PM
nagios check service noir911 Linux - Networking 5 07-24-2006 05:12 PM
can't stop service name shown by nmap mrpc_cambodia Red Hat 1 11-15-2004 07:52 AM
Problem when Nagios Monitoring runs ping service sanfran49 Linux - Software 0 08-22-2003 12:12 PM


All times are GMT -5. The time now is 01:32 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration