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

Re: Plug-In Tutorials

Post by A.Cormack »

lmiltchev wrote:We always try to help, even when dealing with "non-official" (3rd party) plugins, however we cannot guarantee that these plugins will work well with nagios.
Posting on the Nagios Exchange could be helpful - even if the developer of this plugin doesn't answer your question, someone else, who uses the same plugin, and has faced the same issue might.
I understand completly.

The issue I'm having is my project states I will test/trial/evaluate 3 plug-ins. "check_apacherequests", "check_apache_status" and "check_access_log", so if I am unable to use these or alternatives which offer the same service then I am forced to re-write my project. Which this far down the line would be a bit of a disaster. But at the same time I acknowledge some things just can't be helped.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Plug-In Tutorials

Post by abrist »

There are a number of plugins that deal with apache, so if you could drop in a replacement without affecting your project too much, it may be an option.

http://exchange.nagios.org/index.php?op ... ord=apache
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 »

abrist wrote:There are a number of plugins that deal with apache, so if you could drop in a replacement without affecting your project too much, it may be an option.

http://exchange.nagios.org/index.php?op ... ord=apache
Yeah, I'm just trying to other 2 plug-ins which I wanted to use to make sure they work. If not I'll check exchange for replacements.

Is it possible we can leave this thread open? As no doubt I'll need more advise with the other two plug-ins.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Plug-In Tutorials

Post by slansing »

Yes we can, make sure to test the plugins from the command line before configuring with the .cfg's! :)
A.Cormack
Posts: 103
Joined: Fri Nov 23, 2012 6:32 pm

Re: Plug-In Tutorials

Post by A.Cormack »

Ok so I'm now trying "check_apache_status": http://exchange.nagios.org/directory/Pl ... us/details

Started by going into the admin sections and manage plugins. Uploaded the file and received the sucessful installation notification.

Went into the Nagios server and typed

Code: Select all

cd /usr/local/nagios/libexec
./check_apache_status -H
with output

Code: Select all

[root@localhost libexec]# ./check_apache_status -h
Unknown option: h
        check_apache_status
        Fetches the server-status page of an apache, extracts some information a

        usage: check_apache_status -H HOSTNAME -v VARNAME [-c LIMIT] [-w LIMIT]

        VARNAME might be one of:
                traffic                 provided in MB
                requests_per_second     LiB
                bytes_per_request       LiB
                accesses                LiB
                bytes_per_second        LiB
                idle_worker             HiB
                current_requests        LiB
                uptime                  [will allways deliver UNKNOWN]

        HiB = Higher is Better
        LiB = Lower is Better


So taking your advise on board (testing in command prompt). I entered the command...

Code: Select all

[root@localhost libexec]# ./check_apache_status -H 192.168.19.136 -v requests_per_second -c 3 -w 2
and received an error saying

Code: Select all

APACHE UNKNOWN: 192.168.19.136 did not deliver information 
Now my understanding is that this error is occuring due to my server denying the plug-in access to its information. However, I am unsure why as all its services are currently green in the Nagios server centre. Is there something I need to modify in order to allow the plug-in retrieve the information it needs?
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Plug-In Tutorials

Post by sreinhardt »

Can you run your check again and follow it with "echo $?" the status of a check in nagios is determined by the exit code of the plugin, the echo command will display that.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
A.Cormack
Posts: 103
Joined: Fri Nov 23, 2012 6:32 pm

Re: Plug-In Tutorials

Post by A.Cormack »

Didn't seem to work but no doubt im doing something wrong

Code: Select all

[root@localhost libexec]# ./check_apache_status -H 192.168.19.136 -v requests_per_second -c 3 -w 2 echo $?
APACHE UNKNOWN: 192.168.19.136 did not deliver information.
[root@localhost libexec]# ./check_apache_status -H 192.168.19.136 -v requests_per_second -c 3 -w 2 echo $
APACHE UNKNOWN: 192.168.19.136 did not deliver information.
[root@localhost libexec]# ./check_apache_status -H 192.168.19.136 -v requests_per_second -c 3 -w 2 echo$
APACHE UNKNOWN: 192.168.19.136 did not deliver information.
[root@localhost libexec]# ./check_apache_status -H 192.168.19.136 -v requests_per_second -c 3 -w 2 echo$?
APACHE UNKNOWN: 192.168.19.136 did not deliver information.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Plug-In Tutorials

Post by slansing »

It looks like lmiltchev and I are getting the same problem on our end, after reading through the script it looks like it requires some perl modules that do not exist anymore. This plugin appears to be over 2 years old at this point though many older plugins still work some which rely on specific packages do not.

What exactly are you looking for in the plugins you are testing, I will go out and hunt some down for you that will work properly since we have having a heck of a time by using older out dated versions.
A.Cormack
Posts: 103
Joined: Fri Nov 23, 2012 6:32 pm

Re: Plug-In Tutorials

Post by A.Cormack »

Well for the first part of my project I evaluated/tested Nagios's (without the use of plug-ins) ability to monitor servers that may be found within a small business (Windows and Ubuntu).

For the second part of my project I'm going a bit more in depth. I wanted to test Nagios's ability along with the use of plug-ins to monitor a more specialised server that would be found in a small business, in this case Apache. As I am also evaluating the level of technical expertise required to use Nagios/Plug-ins (As my final recommendation will be whether or not to use nagios in several small business's around Sheffield, UK) I wanted to keep the plug-in uses simple.

So long story short, I'm looking for 3 plug-ins which work to enchance Apache monitoring. I have no particular preference just something that will give me information/data to evaluate. As I have access to limited technology I was hoping for something simple such as requests, performance monitoring, log monitoring etc.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Plug-In Tutorials

Post by slansing »

It looks like nobody mentioned when they uploaded their plugins that you you need mod status enabled to read the information from apache, one of the plugins says this and I was able to get check_apachestatus.pl working with Nagios now.

Check out this link:

http://httpd.apache.org/docs/2.2/mod/mod_status.html

You will need to edit /etc/httpd/conf/httpd.conf and add the following line to the bottom:

Code: Select all

<Location /server-status>
SetHandler server-status

#Order Deny,Allow
#Deny from all
#Allow from .example.com
</Location> 
And then search for ExtendedStatus and un-comment its line so that it is set to on.

If you are using VI or VIM to edit, you can use the "/" followed by the text you need to search for and hit enter. This will take you to the line it is located on.
Locked