Page 1 of 6
Plug-In Tutorials
Posted: Mon Feb 25, 2013 2:59 pm
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
Re: Plug-In Tutorials
Posted: Mon Feb 25, 2013 3:14 pm
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
Re: Plug-In Tutorials
Posted: Mon Feb 25, 2013 3:19 pm
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.
Re: Plug-In Tutorials
Posted: Mon Feb 25, 2013 3:23 pm
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.
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.
Re: Plug-In Tutorials
Posted: Mon Feb 25, 2013 3:29 pm
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
Re: Plug-In Tutorials
Posted: Mon Feb 25, 2013 3:46 pm
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.
Re: Plug-In Tutorials
Posted: Mon Feb 25, 2013 3:50 pm
by slansing
Great, let us know what you need further help with in configuring the plugin.
Re: Plug-In Tutorials
Posted: Mon Feb 25, 2013 3:52 pm
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:
Re: Plug-In Tutorials
Posted: Mon Feb 25, 2013 3:56 pm
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.
Re: Plug-In Tutorials
Posted: Mon Feb 25, 2013 4:04 pm
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:
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.