Skip to main content

Squid SNMP

Pack assets​

Monitored objects​

  • Cache Usage
  • Protocol statistics

Collected metrics & status​

Metric nameDescriptionUnit
cache.cpu.utilization.percentageCpu usage%
cache.memory.usage.bytesMemory usageB
cache.filedescriptors.countNumber of file descriptorscount
cache.objects.countNumber of object storedcount

Prerequisites​

To use this pack, the SNMP service must be properly configured on your Squid proxy. Squid provides an official documentation to achieve this: https://wiki.squid-cache.org/Features/Snmp

Network flow​

The Squid proxy must be reachable from the Centreon Poller on the UDP/161 SNMP port.

Setup​

  1. Install the Centreon Plugin package on every Centreon poller expected to monitor your Squid proxy ressources:
yum install centreon-plugin-Applications-Squid-Snmp
  1. On the Centreon Web interface, install the Squid SNMP Centreon Plugin Pack on the Configuration > Plugin Packs page

Configuration​

Host​

  • Log into Centreon and add a new Host through Configuration > Hosts.
  • Fill the "Name", "Alias" & "IP Address / DNS" fields according to your Squid proxy settings
  • Select the Applications-Squid-Snmp-custom template to apply to the Host

If you are using SNMP Version 3, use the SNMPEXTRAOPTIONS Macro to configure your own SNMPv3 credentials combo.

MandatoryNameDescription
SNMPEXTRAOPTIONSConfigure your own SNMPv3 credentials combo

How to check in the CLI that the configuration is OK and what are the main options for ?​

Once the plugin installed, log into your Centreon Poller CLI using the centreon-engine user account and test the Plugin by running the following command:

/usr/lib/centreon/plugins//centreon_squid_snmp.pl \
--plugin=apps::squid::snmp::plugin \
--mode=cache-usage \
--hostname='10.0.0.1' \
--snmp-version='2c' \
--snmp-community='my-snmp-community' \
--filter-counters='' \
--warning-cpu='80' \
--critical-cpu='90' \
--use-new-perfdata

Expected command output is shown below:

OK : Cpu usage: 30 % Memory usage: 265289728 B Number of file descriptors: 45 Number of object stored: 23 | 'cache.cpu.utilization.percentage'=30%;;;0;100 
'cache.memory.usage.bytes'=265289728B;;;0; 'cache.filedescriptors.count'=45;;;0; 'cache.objects.count'=23;;;0;

This command would trigger a WARNING alarm if the cpu utilization is reported as over 80% (--warning-cpu='80') and a CRITICAL alarm if over 90% (--critical-cpu='90').

All available options for a given mode can be displayed by adding the --help parameter to the command:

/usr/lib/centreon/plugins//centreon_squid_snmp.pl  \
--plugin=apps::squid::snmp::plugin \
--mode=cache-usage \
--help

All available options for a given mode can be displayed by adding the --list-mode parameter to the command:

 /usr/lib/centreon/plugins//centreon_squid_snmp.pl  \
--plugin=apps::squid::snmp::plugin \
--list-mode

Troubleshooting​

UNKNOWN: SNMP GET Request : Timeout​

If you get this message, you're probably facing one of theses issues:

  • Your SNMP server isn't started or misconfigured
  • An external device is blocking your request (firewall, ...)

UNKNOWN: SNMP GET Request : Cant get a single value​

This message generally means that SNMP privileges are not wide enough for the mode/Plugin to work properly.