Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me
Don't miss your chance to attend the 2014 Nagios World conference!

Don't miss your chance to attend the 2014 Nagios World Conference, Oct 13-16th. Informative Sessions, Networking, Food and Cocktails! Visit go.nagios.com/conference/ for more information or to register.


check_squid

Bookmark and Share

Rating
5 votes
Favoured:
0
Owner
Hits
153615
Files:
FileDescription
check_squidcheck_squid
check_squid is a plugin to nagios for monitoring Squid by using squidclient
check_squid is a plugin to nagios for monitoring Squid by using squidclient
Wrote in perl, It require NAGIOS::Plugin to work.
Actualy in version 1.00
Reviews (3)
The script has a good conceptual bases .. and pulls in squid info using 'squidclient -h $HOSTADDRESS$ -p SQUIDPORT mgr:info' ..

But it makes an assumption that users of the script would first check required ACLs for the squid deployment, and modifying the script accordingly .. although it does keep silent on this.

You get the 'uninitialized value' warning (mentioned above) when the squidclient command fails because the script is not checking its return value before proceeding to attempt to parse the output of squidclient ..

Still great that the author shared this .. and it can cleaned up and adapted relatively easily.

> Use of uninitialized value in sprintf at /usr/local/share/perl5/Nagios/Plugin/Performance.pm
To "fix" this warning, please change the next lines in source code:

# Hits as % of all requests: 5min: 23.6%, 60min: 19.7%
$line =~ /s+Request Hit Ratios:s+5min:s+([0-9.]+)%,s+60min:s+([0-9.]+)%/ and $cache_requesthitratio5 = $1 and $cache_requesthitratio60 = $2;
# Byte Hit Ratios: 5min: 23.7%, 60min: 20.9%
$line =~ /s+Byte Hit Ratios:s+5min:s+([0-9.]+)%,s+60min:s+([0-9.]+)%/ and $cache_bytehitratio5 = $1 and $cache_bytehitratio60 = $2;

by

# Hits as % of all requests: 5min: 23.6%, 60min: 19.7%
$line =~ /s+Hits as % of all requests:s+5min:s+([0-9.]+)%,s+60min:s+([0-9.]+)%/ and $cache_requesthitratio5 = $1 and $cache_requesthitratio60 = $2;
# Hits as % of bytes sent: 5min: 1.4%, 60min: 5.1%
$line =~ /s+Hits as % of bytes sent:s+5min:s+([0-9.]+)%,s+60min:s+([0-9.]+)%/ and $cache_bytehitratio5 = $1 and $cache_bytehitratio60 = $2;
byHermit, April 4, 2012
1 of 1 people found this review helpful
I have a problem with check_squid. Can you help me?

# ./check_squid
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.
SQUID OK - Squid have clients and ICP requests queued | 'HTTP requests'=c;; 'sent ICP requests'=c;; 'received ICP requests'=c;;