LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-19-2012, 03:57 AM   #1
call_krushna
Member
 
Registered: Aug 2007
Location: India
Distribution: Ubuntu
Posts: 173

Rep: Reputation: 1
check_nrpe command giving wrong value


Hi team,

I have written a small plugin to check vidispine realm authorisation using the wget command as follows .

#!/bin/sh
WGET=/usr/bin/wget
URL=http://localhost:8080/API/version
$WGET --user=admin --password=admin123 $URL 2> /dev/null
if [ $? = "0" ]; then
rm -rf version; echo "Vidispine realm ok" ; exit 0
else
rm -rf version; echo "Vidispine realm not working" ;exit 1
fi

if I run this script in remote server(192.168.0.237 ), working fine

#/usr/local/nagios/libexec/check_vidispinerealm
Vidispine realm ok

but when I am trying the same script using check nrpe from nagios server ,it is giving wrong value

Nagios-server#/usr/local/nagios/libexec/check_nrpe -H 192.168.0.237 -c check_vidispinerealm
Vidispine realm not working

Note :On 192.168.0.237 ,I have copied to script to /usr/local/nagios/libexec folder ,given execute permission to nagios user and added the entry in nrpe.cfg


Any help will be highly appreciable .
Thanks in advance
 
Old 11-19-2012, 10:58 PM   #2
sag47
Senior Member
 
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
Blog Entries: 36

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
What does the entry in your nrpe.cfg look like? Also please use [CODE] tags when you're displaying code.

Curl might be a better option for what you're attempting than wget.
Code:
curl --user name:password http://www.example.com
Have you tried executing the script as the nagios user?
Code:
# su - nagios
$ /usr/local/nagios/libexec/check_vidispinerealm

Last edited by sag47; 11-19-2012 at 11:03 PM.
 
1 members found this post helpful.
Old 11-19-2012, 11:43 PM   #3
call_krushna
Member
 
Registered: Aug 2007
Location: India
Distribution: Ubuntu
Posts: 173

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by sag47 View Post
What does the entry in your nrpe.cfg look like? Also please use [CODE] tags when you're displaying code.

Curl might be a better option for what you're attempting than wget.
Code:
curl --user name:password http://www.example.com
Have you tried executing the script as the nagios user?
Code:
# su - nagios
$ /usr/local/nagios/libexec/check_vidispinerealm
Thanks for reply . I will try with curl and get back you . To fix immediately , I have used check_http -a .
 
Old 11-20-2012, 01:39 AM   #4
call_krushna
Member
 
Registered: Aug 2007
Location: India
Distribution: Ubuntu
Posts: 173

Original Poster
Rep: Reputation: 1
Talking

Quote:
Originally Posted by call_krushna View Post
Thanks for reply . I will try with curl and get back you . To fix immediately , I have used check_http -a .
Hi sag47,

Thanks a ton for reply .The problem was , while using wget ,it used to download one file called version .Since no permission was set to the existing folder ,it was giving wrong output .In my plugin script , I have added extra line i.e.

cd /usr/local/nagios

Now it is working fine .Thanks for pointing out this .
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is df giving wrong numbers? stf92 Slackware 4 09-11-2011 12:29 PM
[SOLVED] [NAGIOS] can't find check_nrpe after 'yum install check_nrpe' di11rod Linux - Software 4 06-29-2011 01:52 PM
Nginx giving a 403 error. I don't know what's wrong. arco123 Linux - Server 2 02-08-2011 02:34 AM
[SOLVED]xbindkeys giving wrong mapping information narnie Linux - Hardware 1 04-08-2010 12:37 AM
uname giving wrong info ddu_ Linux - Newbie 2 06-14-2007 09:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:26 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration