Page 4 of 6

Re: Plug-In Tutorials

Posted: Tue Feb 26, 2013 1:20 pm
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.

Re: Plug-In Tutorials

Posted: Tue Feb 26, 2013 1:31 pm
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

Re: Plug-In Tutorials

Posted: Tue Feb 26, 2013 1:42 pm
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.

Re: Plug-In Tutorials

Posted: Tue Feb 26, 2013 1:53 pm
by slansing
Yes we can, make sure to test the plugins from the command line before configuring with the .cfg's! :)

Re: Plug-In Tutorials

Posted: Tue Feb 26, 2013 2:15 pm
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?

Re: Plug-In Tutorials

Posted: Tue Feb 26, 2013 2:37 pm
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.

Re: Plug-In Tutorials

Posted: Tue Feb 26, 2013 2:42 pm
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.

Re: Plug-In Tutorials

Posted: Tue Feb 26, 2013 2:46 pm
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.

Re: Plug-In Tutorials

Posted: Tue Feb 26, 2013 2:54 pm
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.

Re: Plug-In Tutorials

Posted: Tue Feb 26, 2013 4:13 pm
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.