nagios-apache - Scoreboard - Installlation help

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
ecarrasq
Posts: 244
Joined: Tue Feb 22, 2011 5:58 pm

nagios-apache - Scoreboard - Installlation help

Post by ecarrasq »

Linux Distribution and version? Red Hat 6
32 or 64bit? 64bit
VMware Image or Manual Install of XI? Manual install
Are there specials configurations on your system, ie; is Gnome installed? No
Are you using a proxy? No
Are you using SSL? Yes, for the web portal of Nagios Xi
Nagios Version? NagiosXi 2012R1.0

I am trying to install and use the nagios-apache (check_apache):

http://exchange.nagios.org/directory/Pl ... he/details

In the installation instructions it lists several things that are not 100% clear:

Copy the plugins out of the plugins directory and put them into Nagios' plugins directory on the Nagios server (this is usually /usr/lib64/nagios/plugins on a 64-bit RHEL/CentOS box).
Copy the plugins out of the plugins directory = the plugins directory from http://exchange.nagios.org/directory/Pl ... he/details ? Also this directory does not exist: /usr/lib64/nagios/plugins
Copy the pnp4nagios templates out of the pnp4nagios/templates directory and put them into pnp4nagios' templates directory (On EL6 using the pnp4nagios package from EPEL, this directory is /usr/share/nagios/html/pnp4nagios/templates).
Please let me know in detail how to do this if possible, as this directory does not exist either /usr/share/nagios/html/pnp4nagios/templates
Copy the pnp4nagios check commands configs out of the pnp4nagios/check_commands directory and put them in pnp4nagios' check_commands directory. Using the same package from EPEL as above, this is /etc/pnp4nagios/check_commands. Do this BEFORE configuring the service checks in Nagios otherwise the RRD's will get created with the wrong data types (To fix this, just delete the .rrd files and start over).
Please let me know in detail how to do this if possible

I greatly appreciate any help on this.

Thank you,
Eddie
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: nagios-apache - Scoreboard - Installlation help

Post by scottwilkerson »

Please be aware that the exchange is used both by Nagios Core users and XI users, so the instructions from the contributor are likely specific to their installation

You can upload the plugin through Admin -> Manage Plugins you will also need to create the command in Configure -> CCM -> Commands
http://library.nagios.com/library/produ ... -nagios-xi

You can upload the PNP template through Admin -> graph Templates
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
ecarrasq
Posts: 244
Joined: Tue Feb 22, 2011 5:58 pm

Re: nagios-apache - Scoreboard - Installlation help

Post by ecarrasq »

I followed the instructions listed above and from the developer's site, but seems like I have some dependencies/ownership/permissions/or pathing issue that need to be met in order for it to work and I have not been able to figure out.

I'll detailed what I've done so far:

0. I made sure mod_status is enabled and ExtendedStatus set to On.
1. I uploaded the plugin through NagiosXi Admin -> Manage Plugins
2. Created the command in Configure -> CCM -> Commands
3. Uploaded the PNP template through Admin -> graph Templates

These are the following errors I've received:

1. From NagiosXi after running the service check, the output I get is "null"

2. From NagiosXi Plugin Tool Wizard, the output I get is:
Command Executed:
/usr/local/nagios/libexec/check_apache -H <webserver> -p 443


Output:
Can't locate JSON.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/nagios/libexec/check_apache line 29.
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/check_apache line 29.
3. From the shell prompt, I tried executing the command manually by:
Command Executed:
/usr/local/nagios/libexec/check_apache -H <webserver> -p 443

Output:
Use of uninitialized value in sprintf at /usr/local/share/perl5/Nagios/Plugin/Performance.pm line 68.
Use of uninitialized value in sprintf at /usr/local/share/perl5/Nagios/Plugin/Performance.pm line 68.
Use of uninitialized value in sprintf at /usr/local/share/perl5/Nagios/Plugin/Performance.pm line 68.
Use of uninitialized value in sprintf at /usr/local/share/perl5/Nagios/Plugin/Performance.pm line 68.
Use of uninitialized value in sprintf at /usr/local/share/perl5/Nagios/Plugin/Performance.pm line 68.
Use of uninitialized value in sprintf at /usr/local/share/perl5/Nagios/Plugin/Performance.pm line 68.
Use of uninitialized value in sprintf at /usr/local/share/perl5/Nagios/Plugin/Performance.pm line 68.
Use of uninitialized value in sprintf at /usr/local/share/perl5/Nagios/Plugin/Performance.pm line 68.
Apache Stats OK - yup | hits=;; bytes=;; busy=;; idle=;; s0=0;; s1=0;; s2=0;; s3=0;; s4=0;; s5=0;; s6=0;; s7=0;; s8=0;; s9=0;; s10=0;;

I also tried the following:

Based on the instructions of their site:
Copy the plugins out of the plugins directory and put them into Nagios' plugins directory on the Nagios server (this is usually /usr/lib64/nagios/plugins on a 64-bit RHEL/CentOS box).
the "nagios" directory does not exist

Copy the pnp4nagios templates out of the pnp4nagios/templates directory and put them into pnp4nagios' templates directory (On EL6 using the pnp4nagios package from EPEL, this directory is /usr/share/nagios/html/pnp4nagios/templates).
Don't know what EPEL is, and how to get that package other than the file from the site. I manually created the non-existing folder /usr/share/nagios/html/pnp4nagios/templates incase the script called, for it, but no luck
Copy the pnp4nagios check commands configs out of the pnp4nagios/check_commands directory and put them in pnp4nagios' check_commands directory. Using the same package from EPEL as above, this is /etc/pnp4nagios/check_commands. Do this BEFORE configuring the service checks in Nagios otherwise the RRD's will get created with the wrong data types (To fix this, just delete the .rrd files and start over).
Could not understand this part, but tried my best with NagiosXi as described above.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: nagios-apache - Scoreboard - Installlation help

Post by scottwilkerson »

First, this
ecarrasq wrote:an't locate JSON.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/nagios/libexec/check_apache line 29.
means you are missing a package, run

Code: Select all

yum install perl-JSON -y
Then try this again

Code: Select all

/usr/local/nagios/libexec/check_apache -H <webserver> -p 443
All of this is related to Nagios Core and not necessary because you completed the 4 steps above
ecarrasq wrote:Based on the instructions of their site:

Copy the plugins out of the plugins directory and put them into Nagios' plugins directory on the Nagios server (this is usually /usr/lib64/nagios/plugins on a 64-bit RHEL/CentOS box).



the "nagios" directory does not exist


Copy the pnp4nagios templates out of the pnp4nagios/templates directory and put them into pnp4nagios' templates directory (On EL6 using the pnp4nagios package from EPEL, this directory is /usr/share/nagios/html/pnp4nagios/templates).



Don't know what EPEL is, and how to get that package other than the file from the site. I manually created the non-existing folder /usr/share/nagios/html/pnp4nagios/templates incase the script called, for it, but no luck

Copy the pnp4nagios check commands configs out of the pnp4nagios/check_commands directory and put them in pnp4nagios' check_commands directory. Using the same package from EPEL as above, this is /etc/pnp4nagios/check_commands. Do this BEFORE configuring the service checks in Nagios otherwise the RRD's will get created with the wrong data types (To fix this, just delete the .rrd files and start over).



Could not understand this part, but tried my best with NagiosXi as described above.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
ecarrasq
Posts: 244
Joined: Tue Feb 22, 2011 5:58 pm

Re: nagios-apache - Scoreboard - Installlation help

Post by ecarrasq »

I got a little further. I'm not getting the "can't locate JSON..." after installing all the modules correctly via yum; However, I'm still getting the following:
Use of uninitialized value in sprintf at /usr/local/share/perl5/Nagios/Plugin/Performance.pm line 68.
Use of uninitialized value in sprintf at /usr/local/share/perl5/Nagios/Plugin/Performance.pm line 68.
Use of uninitialized value in sprintf at /usr/local/share/perl5/Nagios/Plugin/Performance.pm line 68.
Use of uninitialized value in sprintf at /usr/local/share/perl5/Nagios/Plugin/Performance.pm line 68.
Use of uninitialized value in sprintf at /usr/local/share/perl5/Nagios/Plugin/Performance.pm line 68.
Use of uninitialized value in sprintf at /usr/local/share/perl5/Nagios/Plugin/Performance.pm line 68.
Use of uninitialized value in sprintf at /usr/local/share/perl5/Nagios/Plugin/Performance.pm line 68.
Use of uninitialized value in sprintf at /usr/local/share/perl5/Nagios/Plugin/Performance.pm line 68.
Apache Stats OK - good | hits=;; bytes=;; busy=;; idle=;; s0=0;; s1=0;; s2=0;; s3=0;; s4=0;; s5=0;; s6=0;; s7=0;; s8=0;; s9=0;; s10=0;;
The /usr/local/share/perl5/Nagios/Plugin/Performance.pm line 68 file:
59 }
60
61 sub perfoutput {
62 my $self = shift;
63 # Add quotes if label contains a space character
64 my $label = $self->label;
65 if ($label =~ / /) {
66 $label = "'$label'";
67 }
68 my $out = sprintf "%s=%s%s;%s;%s;%s;%s",
69 $label,
70 $self->value,
71 $self->_nvl($self->uom),
72 $self->_nvl($self->warning),
73 $self->_nvl($self->critical),
74 $self->_nvl($self->min),
75 $self->_nvl($self->max);
76 # Previous implementation omitted trailing ;; - do we need this?
77 $out =~ s/;;$//;
78 return $out;
79 }
Any help with this will be greatly appreciated.

Thanks,
Eddie
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: nagios-apache - Scoreboard - Installlation help

Post by scottwilkerson »

Not being the developer of this plugin, I can't guarantee that the plugin isn't sending the required information the the Nagios/Plugin package.

I would suggest contacting the developer either through the Nagios exchange page or through Github, as this may be a known issue.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
ecarrasq
Posts: 244
Joined: Tue Feb 22, 2011 5:58 pm

Re: nagios-apache - Scoreboard - Installlation help

Post by ecarrasq »

Ok thanks. I'm in email communication with the developer, and will share the findings once complete on this post.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: nagios-apache - Scoreboard - Installlation help

Post by scottwilkerson »

Thanks
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
ecarrasq
Posts: 244
Joined: Tue Feb 22, 2011 5:58 pm

Re: nagios-apache - Scoreboard - Installlation help

Post by ecarrasq »

Update:

the check_apache pulls the information from the server-status html:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html><head>
<title>Apache Status</title>
</head><body>
<h1>Apache Server Status for SERVERNAME</h1>

<dl><dt>Server Version: Apache/2.2.3 (Red Hat)</dt>
<dt>Server Built: May 28 2012 08:45:57
</dt></dl><hr /><dl>
<dt>Current Time: Wednesday, 24-Oct-2012 14:05:54 PDT</dt>
<dt>Restart Time: Wednesday, 24-Oct-2012 14:05:49 PDT</dt>
<dt>Parent Server Generation: 0</dt>
<dt>Server uptime: 5 seconds</dt>
<dt>1 requests currently being processed, 7 idle workers</dt>
</dl><pre>W_______........................................................
................................................................
................................................................
................................................................
</pre>
<p>Scoreboard Key:<br />
"<b><code>_</code></b>" Waiting for Connection,
"<b><code>S</code></b>" Starting up,
"<b><code>R</code></b>" Reading Request,<br />
"<b><code>W</code></b>" Sending Reply,
"<b><code>K</code></b>" Keepalive (read),
"<b><code>D</code></b>" DNS Lookup,<br />
"<b><code>C</code></b>" Closing connection,
"<b><code>L</code></b>" Logging,
"<b><code>G</code></b>" Gracefully finishing,<br />
"<b><code>I</code></b>" Idle cleanup of worker,
"<b><code>.</code></b>" Open slot with no current process</p>
<p />
PID Key: <br />
<pre>
28952 in state: W , 28953 in state: _ , 28954 in state: _
28955 in state: _ , 28956 in state: _ , 28957 in state: _
28958 in state: _ , 28959 in state: _ ,
</pre>
<hr />To obtain a full report with current status information you need to use the <code>ExtendedStatus On</code> directive.
<hr>
<table cellspacing=0 cellpadding=0>
<tr><td bgcolor="#000000">
<b><font color="#ffffff" face="Arial,Helvetica">SSL/TLS Session Cache Status:</font></b>
</td></tr>
<tr><td bgcolor="#ffffff">
cache type: <b>SHMCB</b>, shared memory: <b>512000</b> bytes, current sessions: <b>0</b><br>sub-caches: <b>32</b>, indexes per sub-cache: <b>133</b><br>index usage: <b>0%</b>, cache usage: <b>0%</b><br>total sessions stored since starting: <b>0</b><br>total sessions expired since starting: <b>0</b><br>total (pre-expiry) sessions scrolled out of the cache: <b>0</b><br>total retrieves since starting: <b>0</b> hit, <b>0</b> miss<br>total removes since starting: <b>0</b> hit, <b>0</b> miss<br></td></tr>
</table>
</body></html>
In light of that, the Apache Administrator here did not have it set to allow any to connect to it. After allowing the Nagios server to connect and read that file on the remote apache server, I was able to get a little more information by running the check_apache -H HOSTNAME:

Use of uninitialized value in sprintf at /usr/local/share/perl5/Nagios/Plugin/Performance.pm line 68.
Use of uninitialized value in sprintf at /usr/local/share/perl5/Nagios/Plugin/Performance.pm line 68.
Use of uninitialized value in sprintf at /usr/local/share/perl5/Nagios/Plugin/Performance.pm line 68.
Use of uninitialized value in sprintf at /usr/local/share/perl5/Nagios/Plugin/Performance.pm line 68.
Apache Stats OK - good | hits=;; bytes=;; busy=1;; idle=7;; s0=7;; s1=0;; s2=0;; s3=1;; s4=0;; s5=0;; s6=0;; s7=0;; s8=0;; s9=0;; s10=248;;
I provided this info to the developer and will update this post once I get his feedback.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: nagios-apache - Scoreboard - Installlation help

Post by scottwilkerson »

Thanks again
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart