How to put a plugin in use

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
ziedmahjoub
Posts: 142
Joined: Fri Jan 16, 2015 5:22 am

How to put a plugin in use

Post by ziedmahjoub »

Hi,

i have installed Nagios Core 4.0.8 and plugins 2.0.3 !! and i want to add some plugins ! so i have downloaded one (check AVG) antivirus , a .php file , but after downloading it i didn't know what to do ,
and what i must modify to put it in use .

Can someone guid me , or give me a tutorial that can help me !!

thanks
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: How to put a plugin in use

Post by tmcdonald »

You might want to take a look at a general Nagios tutorial, as this can be quite an in-depth topic:

http://tuxradar.com/content/nagios-made-easy
Former Nagios employee
ziedmahjoub
Posts: 142
Joined: Fri Jan 16, 2015 5:22 am

Re: How to put a plugin in use

Post by ziedmahjoub »

tmcdonald wrote:You might want to take a look at a general Nagios tutorial, as this can be quite an in-depth topic:

http://tuxradar.com/content/nagios-made-easy
I've seen it , but i didn't understand many things , its advanced for me i think , because i still new to nagios .

i just want to know if i download a plugin how can i intergrate it , in which config file ?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: How to put a plugin in use

Post by lmiltchev »

I've seen it , but i didn't understand many things , its advanced for me i think , because i still new to nagios .

i just want to know if i download a plugin how can i intergrate it , in which config file ?
You will need to copy the plugin to your plugins directory and change the permissions if you need to. With most of the nagios plugins, you can run the "-h" or "--help" flag to view the usage, for example:

Code: Select all

/path/to/the/plugins/direcotry/<your plugin> -h
Test the plugin from the command line. After you make sure it works, you will need to create a command in the in commands.cfg file. Next, you will need to create a service definition. You can place it wherever you want (ususally in "/usr/local/nagios/etc/objects/" directory) as long as nagios can find it. Check your configuration with:

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Note: your paths may be different; adjust them accordingly.

You can find the Nagios Core documentation here:

http://nagios.sourceforge.net/docs/nagi ... n/toc.html

It can take a lot of work to get nagios configured, especially if you are new to it. If this is too difficult for you, try Nagios XI. It is a lot easier than Nagios Core. You can run monitoring wizards and the configs will be generated for you automatically.

http://www.nagios.com/

Hope this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
ziedmahjoub
Posts: 142
Joined: Fri Jan 16, 2015 5:22 am

Re: How to put a plugin in use

Post by ziedmahjoub »

You will need to copy the plugin to your plugins directory and change the permissions if you need to. With most of the nagios plugins, you can run the "-h" or "--help" flag to view the usage, for example:

Code: Select all

/path/to/the/plugins/direcotry/<your plugin> -h
the path of the plugins directory can be this ? :

Code: Select all

/usr/local/nagios/libexec
for the permissions i will give them full permission to avoid problems.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: How to put a plugin in use

Post by scottwilkerson »

ziedmahjoub wrote:
the path of the plugins directory can be this ? :

Code: Select all

/usr/local/nagios/libexec
for the permissions i will give them full permission to avoid problems.
Yes, can you execute your plugin with the -h to see if there is instructions on how to run from the command line?

Code: Select all

/usr/local/nagios/libexec/<your plugin> -h
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
ziedmahjoub
Posts: 142
Joined: Fri Jan 16, 2015 5:22 am

Re: How to put a plugin in use

Post by ziedmahjoub »

just a question :
there is some plugins that is written : compatible with nagios 3.x or nagios 2.x !!
meanwhile i have installed nagios core 4.0.8 , these plugins can work with nagios 4.x ?!!
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: How to put a plugin in use

Post by abrist »

ziedmahjoub wrote:there is some plugins that is written : compatible with nagios 3.x or nagios 2.x !!
meanwhile i have installed nagios core 4.0.8 , these plugins can work with nagios 4.x ?!!
Yes, the plugin format has not changed for quite some time. All of those should work with 4.x.x.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
ziedmahjoub
Posts: 142
Joined: Fri Jan 16, 2015 5:22 am

Re: How to put a plugin in use

Post by ziedmahjoub »

ok thanks , for now i have added this plugin just to test if i can put new plugins and make them work .

i added this one : http://exchange.nagios.org/directory/Pl ... ld/details (file .pl)

and i added this command in commands.cfg :

Code: Select all

define command{
command_name check_mysqld
command_line $USER1$/check_mysqld.pl -H $HOSTADDRESS$ -u $ARG1$ -p $ARG2$
}
and this service in windows.cfg :

Code: Select all

define service { 
    use                             generic-service 
    hostgroup_name          mysql
    service_description      check SQL  
    check_command          check_mysqld!foo!apples
}
and in the web interface i find a new service called Check SQL , is that means that the plugin is successfully injected ?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: How to put a plugin in use

Post by tmcdonald »

That looks about right!

Give it a few minutes to see if it is running properly and check the output/status info.
Former Nagios employee
Locked