Squid (Windows)

Squid (Windows)

This template allows you to monitor the performance of Squid proxy server installed on a Windows machine by using SNMP and PowerShell monitors.

Prerequisites: WinRM must be installed and properly configured on the target server. SNMP should be installed and configured on the target server. The Squid SNMP module must be configured on the target server:

By default, Squid uses UPD port 3401 for SNMP. You can change this port by using the snmp_port directive in squid.conffile.

The following configuration should be present in the squid.conf file:

acl Snmppublic snmp_community <your_community_string>
acl APMhost src <IP_address_of_SAM_server>
snmp_access allow APMhost Snmppublic

For example:

acl Snmppublic snmp_community public
acl APMhost src 192.168.2.3
snmp_access allow APMhost Snmppublic

After these changes are made, restart Squid.

Configuring Windows Remote Management (WinRM)

1.     If not already done so, install PowerShell 2.0 and WinRM on the SAM and target servers. Powershell 2.0 can be found here: http://support.microsoft.com/kb/968930.

2.     On the SAM server, open a command prompt as an Administrator. To do this, perform the following step:

·         Go to the Start menu and right-click the cmd.exeand then select Run as Administrator.

3.     Enter the following in the command prompt:
       winrm quickconfig
       winrm set winrm/config/client @{TrustedHosts="*"}

4.     On the target server, open a command prompt as an Administrator and enter the following:
       winrm quickconfig
       winrm set winrm/config/client @{TrustedHosts="IP_ADDRESS"}

where IP addressis the IP address of your SAM server.

 

Credentials: Administrator on the target server.

Note: This was tested on Squid 3 for Windows.

Components Monitors

Storage Mem Size

This monitor returns the amount of memory (in kilobytes) currently used to store in-memory objects.

OID: 1.3.6.1.4.1.3495.1.1.2.0

Storage Swap Size

This monitor returns the amount of disk space (in kilobytes) currently used to store on-disk objects.

OID: 1.3.6.1.4.1.3495.1.1.2.0

Page Faults

This monitor returns the number of page faults for the Squid process since it was started.

OID: 1.3.6.1.4.1.3495.1.3.1.1.0

Http Reads

This monitor returns the number of times this process called read( ) on HTTP sockets connected to origin servers and neighbor caches.

OID: 1.3.6.1.4.1.3495.1.3.1.2.0

Accounted Memory

This monitor returns the amount of memory allocated by the memory pooling routines. Not the same as the total memory used by Squid.

OID: 1.3.6.1.4.1.3495.1.3.1.3.0

Cpu Usage (%)

This monitor returns the CPU utilization, as a percentage, since Squid was started.

OID: 1.3.6.1.4.1.3495.1.3.1.5.0

Stored Objects

This monitor returns the total number of objects currently in the cache.

OID: 1.3.6.1.4.1.3495.1.3.1.7.0

Available File Descriptors

This monitor returns the current number of available (unused) file descriptors.

OID: 1.3.6.1.4.1.3495.1.3.1.10.0

Reserved File Descriptors

This monitor returns the number of reserved file descriptors.

OID: 1.3.6.1.4.1.3495.1.3.1.11.0

Http Requests Received

This monitor returns the total number of HTTP requests received from cache clients.

OID: 1.3.6.1.4.1.3495.1.3.2.1.1.0

Http Hits

This monitor returns the number of client requests that were cache hits.

OID: 1.3.6.1.4.1.3495.1.3.2.1.2.0

Http Errors

This monitor returns the number of client requests that resulted in an error.

OID: 1.3.6.1.4.1.3495.1.3.2.1.3.0

Http Received (KB)

This monitor returns the amount of network traffic, in kilobytes, read from cache clients.

OID: 1.3.6.1.4.1.3495.1.3.2.1.4.0

Http Transmitted (KB)

This monitor returns the amount of network traffic, in kilobytes, written to cache clients.

OID: 1.3.6.1.4.1.3495.1.3.2.1.5.0

ICP Transmitted (KB)

This monitor returns the amount of network traffic, in kilobytes, used for ICP messages sent to neighbors, not including UDP and IP headers.

OID: 1.3.6.1.4.1.3495.1.3.2.1.8.0

ICP Received (KB)

This monitor returns the amount of network traffic, in kilobytes, used for ICP messages received from neighbors, not including UDP and IP headers.

OID: 1.3.6.1.4.1.3495.1.3.2.1.9.0

Requests From Clients

This monitor returns the number of requests forwarded to origin servers and neighbor caches.

OID: 1.3.6.1.4.1.3495.1.3.2.1.10.0

Errors For Client Requests

This monitor returns the number of errors received from origin servers and neighbor caches.

OID: 1.3.6.1.4.1.3495.1.3.2.1.11.0

Traffic Received From Servers (KB)

This monitor returns the amount of network traffic, in kilobytes, read from origin servers and neighbor caches.

OID: 1.3.6.1.4.1.3495.1.3.2.1.12.0

Traffic Sent To Servers (KB)

This monitor returns the amount of network traffic, in kilobytes, written to origin servers and neighbor caches.

OID: 1.3.6.1.4.1.3495.1.3.2.1.13.0

Clients

This monitor returns the number of clients that sent HTTP requests to Squid since it was started.

OID: 1.3.6.1.4.1.3495.1.3.2.1.15.0

IP Cache Requests

This monitor returns the number of requests received by Squid's IP cache. If the ratio of hits to requests is less than 60-75%, you may want to increase the size of your IP cache.

OID: 1.3.6.1.4.1.3495.1.4.1.2.0

IP Cache Hits

This monitor returns the number of lookups that were hits in the IP cache. If the ratio of hits to requests is less than 60-75%, you may want to increase the size of your IP cache.

OID: 1.3.6.1.4.1.3495.1.4.1.3.0

IP Cache Negative Hits

This monitor returns the number of lookups that were negative hits in the IP cache. Certain failed queries may be negatively cached for an amount of time determined by the negative_dns_ttl directive.

OID: 1.3.6.1.4.1.3495.1.4.1.5.0

IP Cache Misses

This monitor returns the number of IP cache misses.

OID: 1.3.6.1.4.1.3495.1.4.1.6.0

FQDN Cache Requests

This monitor returns the number of requests to the FQDN cache.

OID: 1.3.6.1.4.1.3495.1.4.2.2.0

FQDN Cache Hits

This monitor returns the number of FQDN cache requests satisfied as hits.

OID: 1.3.6.1.4.1.3495.1.4.2.3.0

FQDN Cache Negative Hits

This monitor returns the number of FQDN requests satisfied as negative cache hits.

OID: 1.3.6.1.4.1.3495.1.4.2.5.0

FQDN Cache Misses

This monitor returns the number of FQDN cache misses.

OID: 1.3.6.1.4.1.3495.1.4.2.6.0

External DNS Server Requests

This monitor returns the number of DNS queries made by Squid. This counter is reset each time you reconfigure the running Squid process.

OID: 1.3.6.1.4.1.3495.1.4.3.1.0

External DNS Server Replies

This monitor returns the number of DNS replies received by Squid. This counter is reset each time you reconfigure the running Squid process.

OID: 1.3.6.1.4.1.3495.1.4.3.2.0

External DNS Server Processes

For internal DNS (the default) this monitor reports the number of nameservers that Squid knows about. For external DNS, it reports the number of (running) dnsserver helper processes.

OID: 1.3.6.1.4.1.3495.1.4.3.3.0

Squid HTTP Port Monitor

This component monitor tests the ability of a Squid service to accept incoming sessions. By default it monitors 3128 TCP port.

Top 10 Active Sites

This monitor returns the top 10 of the most visited sites for specific proxy client.

Note: You must specify the correct arguments for this component in the Script Arguments field. This PowerShell monitor uses the following argument structure:

IP_address,Path_to_logfile,Time

1)     IP_address– This is the IP address of the computer that uses the target squid server as a proxy server. This argument allows SAM to monitor specific proxy clients.

2)     Path_to_logfile– This is the full path to the squid access.log file.

3)     Time– This argument allows the user to get statistics during the last minute/hour/day/week/month/year.

For example:
If you set Day, you will get the statistics for the last day.

 

Possible values: Minute, Hour, Day, Week, Month, Year. By default, this value it set to Week.

For Example:

 

192.168.2.211,c:\squid\var\logs\access.log,week

Note: Due to the specific way of determining the statistic, there is an issue with showing sites with the “-” symbol in its names.

 

For example:www.some-site.com”,  in the message field we will only receive everything before the dash, as in “www.some”.

Top 10 Blocked Sites

This monitor returns the top 10 most blocked sites which the proxy client tried to open.

Note: You must specify the correct arguments for this component in the Script Arguments field. This PowerShell monitor uses the following argument structure:

IP_address,Path_to_logfile,Time

1)     IP_address– This is the IP address of the computer that uses the target squid server as a proxy server. This argument allows SAM to monitor specific proxy clients.

2)     Path_to_logfile– This is the full path to the squid access.log file.

3)     Time– This argument allows the user to get statistics during the last minute/hour/day/week/month/year.

For example:
If you set Day, you will get the statistics for the last day.

 

Possible values: Minute, Hour, Day, Week, Month, Year. By default, this value it set to Week.

For Example:

 

192.168.2.211,c:\squid\var\logs\access.log,week

Note: Due to the specific way of determining the statistic, there is an issue with showing sites with the “-” symbol in its names.

 

For example:www.some-site.com”,  in the message field will only receive everything before the dash, as in “www.some”.

Traffic Statistic

This monitor returns the total amount of download and upload traffic in MB for a specific proxy client.

Note: You must specify the correct arguments for this component in the Script Arguments field. This PowerShell monitor uses the following argument structure:

IP_address,Path_to_logfile,Time

1)     IP_address– This is the IP address of the computer that uses the target squid server as a proxy server. This argument allows SAM to monitor specific proxy clients.

2)     Path_to_logfile– This is the full path to the squid access.log file.

3)     Time – This argument allows the user to get statistics during the last minute/hour/day/week/month/year.

 

For Example:

192.168.2.211,c:\squid\var\logs\access.log,week

Process: squid

This monitor returns the CPU and memory usage of the Squid process

 

Portions of this document were originally created by and are excerpted from the following sources:

O'Reilly Media, Inc., “O’Reilly Squid the Definitive Guide,” Copyright © 2004 O'Reilly Media, Inc. 

All rights reserved. Available at http://www.scribd.com/sivatcs/d/77305197-O-Reilly-Squid-the-Definitive-Guide.