Plug-In Tutorials

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
A.Cormack
Posts: 103
Joined: Fri Nov 23, 2012 6:32 pm

Plug-In Tutorials

Post by A.Cormack »

Hi Everyone,

I'm just wondering if there's any guides out there that help you install plug-ins for the first time. I did watch a video on the Nagios YouTube channel (http://www.youtube.com/watch?v=jG1lVnire4E) but that doesn't seem to apply to the plug-in I'm installing. The plug-ins I'm trying to install are aimed at monitoring an Apache server. The first plug-in in i'm trying to install is check_apacherequest found at(http://exchange.nagios.org/directory/Pl ... st/details).

I used the managed plug-in section found on the admin tab to upload the "check_apacherequests.pl" file. However when going to the "usr/local/nagios/libexec" directory the plug-in was no where to be seen. There was a comment on that page that stated "I had to change use lib line to /usr/local/nagios/libexec because it was looking to /usr/lib/nagios/plugins." but when looking at the .pl file I could see no mention of the "/usr/local/nagios/plugins" directory in order for it to be changed.

So I'm just wondering if there are any other video's/guides that will help me sucessfully install this plug-in and several others?

OS: Ubuntu Server 12.04
Nagios Version: Nagios XI

Thanks
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Plug-In Tutorials

Post by lmiltchev »

Please, review our documentation on managing plugins in Nagios XI:

http://assets.nagios.com/downloads/nagi ... ios_XI.pdf

You you are unsure how to test check commands from the command line, you can also review this post:

http://support.nagios.com/wiki/index.ph ... mmand-line
Be sure to check out our Knowledgebase for helpful articles and solutions!
A.Cormack
Posts: 103
Joined: Fri Nov 23, 2012 6:32 pm

Re: Plug-In Tutorials

Post by A.Cormack »

Hi Limit,

Thanks for the reply. The tutorial document which you have linked me is a text base version of the tutorial video which is found on your YouTube channel. However, when attempting to access the plug-in after uploading it via the admin/manage plugin section, the plugin can not be seen in the listed directory.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Plug-In Tutorials

Post by abrist »

A.Cormack wrote: I used the managed plug-in section found on the admin tab to upload the "check_apacherequests.pl" file. However when going to the "usr/local/nagios/libexec" directory the plug-in was no where to be seen.

What version of XI are you running? Is the plugin listed in the admin "manage plugins" list? If not, try uploading it again. Otherwise you could copy it to the /usr/local/nagios/libexec folder by hand from the cli.
There was a comment on that page that stated "I had to change use lib line to /usr/local/nagios/libexec because it was looking to /usr/lib/nagios/plugins." but when looking at the .pl file I could see no mention of the "/usr/local/nagios/plugins" directory in order for it to be changed.
It may be old info as I cannot find any reference to the lib directory in the plugin as well. Although, the plugin does use the cli web browser "lynx" for the check, so you may need to install lynx before it will work.

Code: Select all

apt-get install lynx
Additionally, you will have to make a check command for the plugin in XI under the CCM -> Commands.
So I'm just wondering if there are any other video's/guides that will help me sucessfully install this plug-in and several others?
Every plugin is unique in it's own way. The ease of setting up a plugin all depends on the complexity of said plugin. Some plugins have better documentation than others, and some have better support from the original author on the exchange than others. Usually it is best to decide what you need to monitor, and then peruse the xi wizards and the plugins on the exchange for viable candidates.
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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Plug-In Tutorials

Post by lmiltchev »

What is the version of Nagios XI that you are using? When you go to: Admin->Manage Plugins->Browse->...->and clicked on the "Upload Plugin" button, did you see a confirmation, that the plugin was indeed installed?
New plugin was installed successfully.
I was not able to recreate this issue - I believe I installed the same plugin, and I can see it in both, the web interface, and in terminal:

Code: Select all

check_apacherequests.pl	apache	apache	rwxr-xr-x	02/25/2013 14:22:44

Code: Select all

ll | grep check_apacherequests.pl
-rwxr-xr-x 1 apache apache    2210 Feb 25 14:22 check_apacherequests.pl
Be sure to check out our Knowledgebase for helpful articles and solutions!
A.Cormack
Posts: 103
Joined: Fri Nov 23, 2012 6:32 pm

Re: Plug-In Tutorials

Post by A.Cormack »

Nagios version: 2012R1.2

I did indeed get the following message after uploading it...

Code: Select all

New plugin was installed successfully
which gives me the feeling its putting it in the wrong directory?

-----

The apt-get install lynx command doesnt seem to be working?

-----EDIT-----

I just ran it again and restarted the server. The file is now in the directory.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Plug-In Tutorials

Post by slansing »

Great, let us know what you need further help with in configuring the plugin.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Plug-In Tutorials

Post by abrist »

A.Cormack wrote: The apt-get install lynx command doesnt seem to be working?
You need to be root to install new packages:

Code: Select all

sudo apt-get install lynx
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.
A.Cormack
Posts: 103
Joined: Fri Nov 23, 2012 6:32 pm

Re: Plug-In Tutorials

Post by A.Cormack »

slansing wrote:Great, let us know what you need further help with in configuring the plugin.
You read my mind. I've gone to the command bit of the CMM and added a new command.

Command Name: check_apacherequests
Command Type: checkcommand
Avaliable Plugins: check_apacherequests.pl

Now for the command bit I did have

Code: Select all

$USER1$/check_apacherequests -H $HOSTADDRESS$
is this right?

p.s - Yeah abrist, thats the command I tried. Sorry I have a habbit of not putting sudo in forum posts.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Plug-In Tutorials

Post by slansing »

Within the command you will also want to place variables which can be filled by the service definition such as:

Code: Select all

$USER1$/check_apacherequests -H $HOSTADDRESS$ -a $ARG1$
This may not work for that plugin, you will need to see what flags you want to use in the check, you can do this in most cases by expanding the attached help flag on the plugin:

Code: Select all

./check_apacherequests -h
This would be running the plugin with the -h flag from it's directory. From here you can pick and choose what you want in your command. You could hard code the values in if you wanted, and it would look like it does if you run the one liner version from the command line to test it. Though most people prefer to use arguments so they can change the values easily through the service config file.

You will want to test the plugin from the command line before configuring these files though, to save yourself time and make sure it works, otherwise you could get to the end and find it wont work at all.
Locked