LinuxQuestions.org
Visit Jeremy's Blog.
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-21-2012, 04:15 AM   #1
divyashree
Senior Member
 
Registered: Apr 2007
Location: bbsr,orissa,India
Distribution: RHEL5 ,RHEL4,CENT OS5,FEDORA,UBUNTU
Posts: 1,347

Rep: Reputation: 135Reputation: 135
custom nrpe plugin in nagios


I have created a custom script with perl. But I am unable to use it in nagios with nrpe to monitor remote system.

On the host its working fine but with nagios its throwing error:

Code:
CHECK_NRPE: Socket timeout
Can any one guide me how to add custom script to use with nrpe remote linux ??

Last edited by divyashree; 11-21-2012 at 06:53 AM.
 
Old 11-21-2012, 10:55 AM   #2
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 14,419

Rep: Reputation: 2532Reputation: 2532Reputation: 2532Reputation: 2532Reputation: 2532Reputation: 2532Reputation: 2532Reputation: 2532Reputation: 2532Reputation: 2532Reputation: 2532
Quote:
Originally Posted by divyashree View Post
I have created a custom script with perl. But I am unable to use it in nagios with nrpe to monitor remote system. On the host its working fine but with nagios its throwing error:
Code:
CHECK_NRPE: Socket timeout
Can any one guide me how to add custom script to use with nrpe remote linux ??
Putting that into Google pulls up lots. First three hits for "custom script to use with nrpe remote"
http://blog.gnucom.cc/2009/event-han...os-using-nrpe/
http://docs.icinga.org/latest/en/nrpe.html
http://www.the-tech-tutorial.com/?p=816

...and the error pulls up:
http://nazeems.wordpress.com/2012/03...er-10-seconds/
 
1 members found this post helpful.
Old 11-21-2012, 12:49 PM   #3
Habitual
Senior Member
 
Registered: Jan 2011
Distribution: Undecided
Posts: 3,159
Blog Entries: 4

Rep: Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760
Quote:
Originally Posted by divyashree View Post
...Can any one guide me how to add custom script to use with nrpe remote linux ??
I outlined the necessary steps here...
http://www.linuxquestions.org/questi...4/#post4830764

Your version of "my_cool_script.sh" [cw]ould be "my_cool_script.pl

The check_nrpe utility is THE MOST BASIC troubleshooting tool they have:
Code:
/usr/local/nagios/libexec/check_nrpe -H localhost
on every host that needs monitoring.

Once those 2 work, you can further test interactivity from the nagios host with
Code:
/usr/local/nagios/libexec/check_nrpe -H re.mo.te.ip
References:
http://debianclusters.org/index.php/..._Configuration
http://www.crucialwebhost.com/blog/u...mote-services/
http://www.debianhelp.co.uk/nagiosconfig.htm

HTH, somewhat.

Last edited by Habitual; 11-21-2012 at 12:50 PM.
 
3 members found this post helpful.
Old 11-21-2012, 10:17 PM   #4
divyashree
Senior Member
 
Registered: Apr 2007
Location: bbsr,orissa,India
Distribution: RHEL5 ,RHEL4,CENT OS5,FEDORA,UBUNTU
Posts: 1,347

Original Poster
Rep: Reputation: 135Reputation: 135
Quote:
Originally Posted by Habitual View Post
I outlined the necessary steps here...
http://www.linuxquestions.org/questi...4/#post4830764

Your version of "my_cool_script.sh" [cw]ould be "my_cool_script.pl

The check_nrpe utility is THE MOST BASIC troubleshooting tool they have:
Code:
/usr/local/nagios/libexec/check_nrpe -H localhost
on every host that needs monitoring.

Once those 2 work, you can further test interactivity from the nagios host with
Code:
/usr/local/nagios/libexec/check_nrpe -H re.mo.te.ip
References:
http://debianclusters.org/index.php/..._Configuration
http://www.crucialwebhost.com/blog/u...mote-services/
http://www.debianhelp.co.uk/nagiosconfig.htm

HTH, somewhat.
Habitual, thanks for the reply.

All these work fine except you last step:

Code:
/usr/local/nagios/libexec/check_nrpe -H re.mo.te.ip -c command
According to you this should work from the nagios server.

But in some of the plugins you dont have to add the command in the nagios server's nrpe.cfg file, but only in the remote machin's nrpe.cfg.

for example:

http://exchange.nagios.org/directory...a-2Epl/details

According to the above link I added that plugin in remote system's nrpe.cfg and added that command in the host.cfg(remote system's) in the nagios server.

And its working fine on the nagios page, though the your last step doesn't work in this case.

Similarly my created plugin doesn't need to be defined in the nagios server's nrpe.cfg but in the remote system's nrpe.cfg and the command to be defined in remotehoste.cfg in nagios server,that's what I have done and it throws error on the nagios page.

Last edited by divyashree; 11-21-2012 at 10:18 PM.
 
Old 11-21-2012, 10:27 PM   #5
divyashree
Senior Member
 
Registered: Apr 2007
Location: bbsr,orissa,India
Distribution: RHEL5 ,RHEL4,CENT OS5,FEDORA,UBUNTU
Posts: 1,347

Original Poster
Rep: Reputation: 135Reputation: 135
Ohh I forgot to add the fullpath of the command in the sudo file of the remote system but only added the path to perl for user nagios.

I added that and it works fine.

Thanks to TBone and Habitual for the reply.
 
Old 11-23-2012, 08:16 AM   #6
Habitual
Senior Member
 
Registered: Jan 2011
Distribution: Undecided
Posts: 3,159
Blog Entries: 4

Rep: Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760
You are very welcome.
Glad it worked out!
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing Nagios agent nrpe, problems following nrpe install steps rfreiberger Linux - Newbie 3 04-19-2010 08:43 AM
Nrpe configuration bhagya Linux - Server 6 04-02-2009 05:49 PM
Nagios - nrpe plugin configuration nitin-saxena Linux - Software 1 10-27-2006 01:50 PM
Nagios NRPE twantrd Linux - Software 1 10-20-2004 08:24 AM
disigner doesn't display the custom plugin 00it45 Programming 0 03-03-2004 04:48 AM


All times are GMT -5. The time now is 12:31 PM.

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