Nagios and Checking Squid

After installing Nagios I created three files to define all the services I wanted to monitor:

  • hosts.cfg
  • hostgroups.cfg
  • services.cfg

Squid
I used the check_squid code from http://workaround.org/squid/nagios-plugin/
adding the relevant details to each of my 3 config files for Nagios.
I encountered a problem though as the check_squid perl script makes use of a Perl module LWP::UserAgent which I then had to install manually using:

perl -MCPAN -eshell “install LWP::UserAgent”

After approximately 101 questions I believe it installed, and I checked the check_squid script from the command line again using:

/usr/local/nagios/libexec/check_squid ‘http://google.com’ ” ” ‘cache1.domain.tld’ ‘8080’ ” ” ‘2’

this time received the expected response:

OK – Status: 200 OK

Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>