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 »

slansing wrote: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.
Ah that's very good to know! Thank You.

I added that section to the bottom of my file. However, I have no ExtendedStatus text in my config file.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Plug-In Tutorials

Post by scottwilkerson »

you likely can add the following just above the other info you added to the file

Code: Select all

ExtendedStatus On
then

Code: Select all

service httpd restart
You should be able to view some information in your browser at

Code: Select all

http://<YOUR_IP>/server-status?auto
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
A.Cormack
Posts: 103
Joined: Fri Nov 23, 2012 6:32 pm

Re: Plug-In Tutorials

Post by A.Cormack »

It doesn't appear to like the command. If i restart it with just the <Location......> then it restarts. But if i add

Code: Select all

ExtendedStatus On
Then it fails to restart.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Plug-In Tutorials

Post by slansing »

What does it tell you when it fails to restart? It should give you some sort of configuration error.
A.Cormack
Posts: 103
Joined: Fri Nov 23, 2012 6:32 pm

Re: Plug-In Tutorials

Post by A.Cormack »

It just says...

Code: Select all

The requested operation has failed
I checked the error log file of the log directory but there was no errors in there.

Im running Apache2.2 on Windows Server 2008
A.Cormack
Posts: 103
Joined: Fri Nov 23, 2012 6:32 pm

Re: Plug-In Tutorials

Post by A.Cormack »

Ah ok, So i checked the EventView in windows (Should of done that before)

It says

Code: Select all

>>> Invalid command 'ExtendedStatus' perhaps mispelled or defined by a module included in the server configuration 
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Plug-In Tutorials

Post by slansing »

Okay, didn't know we were doing this on a Windows system, we have been walking you through this thinking you were trying to first monitor your localhost, and then a linux apache server sorry for the confusion. I've looked at a couple examples of httpd.conf files on windows apache server's at it looks like ExtendedStatus should be able to be added like this.. right above where we added the handler:

Code: Select all

ExtendedStatus On
<Location /server-status>
SetHandler server-status
#Order Deny,Allow
#Deny from all
#Allow from .nimsoft.no
</Location>
A.Cormack
Posts: 103
Joined: Fri Nov 23, 2012 6:32 pm

Re: Plug-In Tutorials

Post by A.Cormack »

Sorry my appologies, I should have explained it better. I need to approach it in a fair approach, so first of all im trying it on a windows server and then ill be trying it on a Ubuntu.

Ok so I went into httpd.conf and the bottom of the file now looks like

Code: Select all

ExtendedStatus On
<Location /server-status>
SetHandler server-status
#Order Deny,Allow
#Deny from all
#Allow from .nimsoft.no
</Location>
But the error still occurs
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Plug-In Tutorials

Post by scottwilkerson »

not totally sure about on the windows system but you may also need to add the module, like

Code: Select all

LoadModule status_module modules/mod_status.so
Also, you will need to restart the windows service for apache
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
A.Cormack
Posts: 103
Joined: Fri Nov 23, 2012 6:32 pm

Re: Plug-In Tutorials

Post by A.Cormack »

Once I uncommend "LoadModule" line, then Apache successfully booted up.

However, when running the test command

Code: Select all

./check_apacherequests.pl
I still get the error message

Code: Select all

Argument "" isn't numeric in numeric ge (>=) at ./check_apacherequests.pl line 76.
OK -  current apache requests | 'apache requests'=;2;3
Locked