LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-25-2010, 02:19 PM   #1
edwardcode
Member
 
Registered: Apr 2010
Posts: 161

Rep: Reputation: 17
Nagios Perl scripts


I have installed Nagios, Nagios Plugins, and NRPE. I want to down load some of the plugins and addons from the exchange, but when I download it I get a .pl file (a perl script) now I want to know what I need to do with the perl file or where I need to put it, as well as, how to configure Nagios or NRPE to read or use the new perl script.
 
Old 05-25-2010, 02:59 PM   #2
jvaldivia
Member
 
Registered: Sep 2007
Distribution: Debian Lenny
Posts: 61
Blog Entries: 2

Rep: Reputation: 19
I wrote a script to use nmap and nagios, I'm sure you can get the information you need for you perl script. Here is the how to I made http://soad1982.blogspot.com/2009/07...-and-nmap.html
 
Old 05-25-2010, 05:19 PM   #3
arashi256
Member
 
Registered: Jan 2008
Location: Brighton, UK
Distribution: Ubuntu 18.04 / CentOS 7.6
Posts: 397

Rep: Reputation: 62
I've written a fair few nagios plugins - do you still need help with this? Once somebody has shown you the basics, it's surprisingly easy to write or install your own plugins. I'll check this thread again tomorrow.
 
Old 05-25-2010, 05:44 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 24,302

Rep: Reputation: 7147Reputation: 7147Reputation: 7147Reputation: 7147Reputation: 7147Reputation: 7147Reputation: 7147Reputation: 7147Reputation: 7147Reputation: 7147Reputation: 7147
Quote:
Originally Posted by edwardcode View Post
I have installed Nagios, Nagios Plugins, and NRPE. I want to down load some of the plugins and addons from the exchange, but when I download it I get a .pl file (a perl script) now I want to know what I need to do with the perl file or where I need to put it, as well as, how to configure Nagios or NRPE to read or use the new perl script.
You need to read the Nagios documentation:

http://nagios.sourceforge.net/docs/3_0/toc.html
http://support.nagios.com/knowledgeb...&showdesc=true

The second link gives you a basic hint as to how to install a plugin, by editing the checkcommands.cfg file.
 
Old 05-26-2010, 08:11 AM   #5
edwardcode
Member
 
Registered: Apr 2010
Posts: 161

Original Poster
Rep: Reputation: 17
I when to nagio exchange to find a working script and now i have one and i put it in the /usr/local/nagios/libexec what is the next step i need to take? What files do i need to configure to make nagios look at my new .pl script
 
Old 05-26-2010, 08:32 AM   #6
arashi256
Member
 
Registered: Jan 2008
Location: Brighton, UK
Distribution: Ubuntu 18.04 / CentOS 7.6
Posts: 397

Rep: Reputation: 62
Quote:
Originally Posted by edwardcode View Post
I when to nagio exchange to find a working script and now i have one and i put it in the /usr/local/nagios/libexec what is the next step i need to take? What files do i need to configure to make nagios look at my new .pl script
Depends - is this script to be run remotely on a server you're monitoring via the NRPE daemon or on the nagios server itself?
 
Old 05-26-2010, 08:46 AM   #7
edwardcode
Member
 
Registered: Apr 2010
Posts: 161

Original Poster
Rep: Reputation: 17
it is to be run on NRPE
 
Old 05-26-2010, 08:59 AM   #8
arashi256
Member
 
Registered: Jan 2008
Location: Brighton, UK
Distribution: Ubuntu 18.04 / CentOS 7.6
Posts: 397

Rep: Reputation: 62
Okay, so put the script in the libexec directory of your NRPE daemon and add the command to the nrpe.cfg: -

command[check_some_custom_command_name]=/usr/local/nagios/libexec/check_somecommand arg1 arg2 arg3

and run it from your services.cfg services definition with something like: -

check_command check_nrpe!check_some_custom_command_name
 
Old 05-26-2010, 09:19 AM   #9
edwardcode
Member
 
Registered: Apr 2010
Posts: 161

Original Poster
Rep: Reputation: 17
i do not have a services file. is the cgi.cfg or the resource.cfg the same thing
 
Old 05-26-2010, 09:44 AM   #10
arashi256
Member
 
Registered: Jan 2008
Location: Brighton, UK
Distribution: Ubuntu 18.04 / CentOS 7.6
Posts: 397

Rep: Reputation: 62
I suggest you read the documentation and get your own services setup with the default plugins before moving on to advanced topics like adding your own plugins and services.
 
Old 05-26-2010, 10:22 AM   #11
edwardcode
Member
 
Registered: Apr 2010
Posts: 161

Original Poster
Rep: Reputation: 17
I still need to get this done though. Can you at least point me in the right direction. For example tell me what i need to look for in the docs.
 
Old 05-26-2010, 11:04 AM   #12
arashi256
Member
 
Registered: Jan 2008
Location: Brighton, UK
Distribution: Ubuntu 18.04 / CentOS 7.6
Posts: 397

Rep: Reputation: 62
You need to look into defining services to monitor for hosts (that I assume you've set up). Once you know the basics of that, my explanation will make sense. The Nagios docs go through this pretty well: -

http://nagios.sourceforge.net/docs/2_0/xodtemplate.html
 
Old 02-18-2011, 12:57 PM   #13
edbennion
LQ Newbie
 
Registered: Feb 2011
Posts: 2

Rep: Reputation: 0
Help

Quote:
Originally Posted by arashi256 View Post
You need to look into defining services to monitor for hosts (that I assume you've set up). Once you know the basics of that, my explanation will make sense. The Nagios docs go through this pretty well: -

http://nagios.sourceforge.net/docs/2_0/xodtemplate.html
I tried to follow the link you specified (I even tried changing 2_0 to 3_0 and was unable to reach the page you specified. I searched for that page and was unsuccessful. I've also read the documentation for both services and commands and so far have been unable to get my perl script to run on my machine. I can run the script if I type "perl check_myscript.pl" but I cannot seem to find anything online on how to set up the command using this notation. Any suggestions?
 
Old 04-12-2013, 09:09 AM   #14
mikasa666
LQ Newbie
 
Registered: Apr 2013
Posts: 1

Rep: Reputation: Disabled
I have nagios with nsca addon. I need to install pearl script
this one: exchange.nagios.org/directory/Addons/Passive-Checks/Radar--2D-add-hosts-and-services-automatically/details
What i need to do to instal this script?
Plzz help me
 
Old 04-12-2013, 03:57 PM   #15
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 24,302

Rep: Reputation: 7147Reputation: 7147Reputation: 7147Reputation: 7147Reputation: 7147Reputation: 7147Reputation: 7147Reputation: 7147Reputation: 7147Reputation: 7147Reputation: 7147
Quote:
Originally Posted by mikasa666 View Post
I have nagios with nsca addon. I need to install pearl script
this one: exchange.nagios.org/directory/Addons/Passive-Checks/Radar--2D-add-hosts-and-services-automatically/details
What i need to do to instal this script?
Plzz help me
Read the instructions that come with it, and open your own thread for your own questions. Also, there are links in this thread that tell you how to configure Nagios and plugins. This thread has been closed for two years now.
 
  


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
AD user login to Nagios - unable to execute CGI scripts in apache dbmacartney Linux - Server 1 10-07-2009 04:33 PM
Fedora Core 9 + Nagios 3.0.6 + Nagiosgraph 1.2.1 - how to get the perl modules JonXP Linux - Newbie 3 03-05-2009 10:39 PM
Perl Script works from command line, but not when evoked by Nagios gfem Linux - General 10 06-05-2008 04:59 PM
perl scripts nightmare6667 Programming 13 06-29-2006 03:21 PM
perl scripts mimf Linux - Newbie 3 12-02-2003 12:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:58 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