Loading ...
close

Would you like to discuss your environment with a knowledgable engineer?

Preferred communication *

Thank you. We will be in touch with you shortly

Nagios Configuration

This page describes the process of configuring Nagios to monitor basic aiScaler operations. We assume that your Nagios is up and running, and that it’s running on Ubuntu (>= 10.04). If not, there are couple of things that you’ll need to figure out on your own (like paths to Nagios plugins or to Nagios configuration files). We also assume, that your SNMP on aiScaler instance has been configured to work with aiScaler. If not, please refer to the aiScaler admin guide.

 

aiScaler Nagios host group definition

The following example shows how to add the host group called aiCache-servers with host called aiCache (with IP 192.168.0.20) as a member of the group.
Open /etc/nagios3/conf.d/hostgroups_nagios2.cfg file with your favourite text editor and add the following lines at the end of the file:
define hostgroup {
hostgroup_name    aiCache-servers
alias             
aiCache-servers
members           aiCache
}

aiScaler Nagios host template definition

Create and edit the aiScaler host template file: /etc/nagios3/conf.d/aicache-host_nagios2.cfg
The file should look like the one below (feel free to modify some of the values if you know what you are doing):
define host {
name                            aiCache-host
notifications_enabled           1

event_handler_enabled           1
flap_detection_enabled          1
failure_prediction_enabled      1
process_perf_data               1
retain_status_information       1
retain_nonstatus_information    1
check_command                   check-host-alive
max_check_attempts              10
notification_interval           0
notification_period             24×7
notification_options            d,u,r
contact_groups                  admins
register                        0
}
 

aiScaler Nagios service template definition

Create and edit the aiScaler host template file: /etc/nagios3/conf.d/aicache-service_nagios2.cfg
The file should look like the one below (feel free to modify some of the values if you know what you are doing):
define service {
name                            aiCache-service
active_checks_enabled           1

passive_checks_enabled          1
parallelize_check               1
obsess_over_service             1
check_freshness                 0
retain_status_information       1
notifications_enabled           1
event_handler_enabled           1
flap_detection_enabled          1
failure_prediction_enabled      1
process_perf_data               1
retain_status_information       1
retain_nonstatus_information    1
notification_interval           0
is_volatile                     0
check_period                    24×7
normal_check_interval           5
retry_check_interval            1
max_check_attempts              4
notification_period             24×7
notification_options            w,u,c,r
contact_groups                  admins
register                        0
}

aiScaler Nagios commands definition

Create and edit the aiScaler commands definition file: /etc/nagios-plugins/config/aicache.cfg
The file should look like below:
define command {
command_name        ai_rt
command_line        /usr/lib/nagios/plugins/ai_rt.pl -H '$HOSTADDRESS$' -c '$ARG1$' -W '$ARG2$' -C '$ARG3$'

}
define command {    command_name        ai_ocr
command_line        /usr/lib/nagios/plugins/ai_ocr.pl -H ‘$HOSTADDRESS$’ -c ‘$ARG1$’ -W ‘$ARG2$’ -C ‘$ARG3$’
}
define command {
command_name        ai_scrcommand_line        /usr/lib/nagios/plugins/ai_scr.pl -H ‘$HOSTADDRESS$’ -c ‘$ARG1$’ -W ‘$ARG2$’ -C ‘$ARG3$’
}
define command {command_name        ai_origin_health
command_line        /usr/lib/nagios/plugins/ai_origin_health.pl -H ‘$HOSTADDRESS$’ -c ‘$ARG1$’ -W ‘$ARG2$’ -C ‘$ARG3$’
}
deinfe command {command_name        ai_origin_health_single
command_line        /usr/lib/nagios/plugins/ai_origin_health.pl -H ‘$HOSTADDRESS$’ -c ‘$ARG1$’
}
 

aiScaler Nagios plugins

Now it’s the time to deploy the Perl scripts (called Nagios plugins). Upload all ai_*.pl files into your Nagios plugins directory (/usr/lib/nagios/plugins/ on Ubuntu). The utils.pm file should already be there, if it’s not, upload it as well. Change the permissions of the ai_*.pl files:
chmod 755 /usr/lib/nagios/plugins/ai_*.pl
There are currently 4 aiScaler Nagios plugins available:
 
ai_rt.pl
Plugin checks the aiScaler global response time in last 5 seconds.
 
Usage:
/usr/lib/nagios/plugins/ai_rt.pl -H aiScaler_hostname -c SNMP_community_name -W warning_threshold -C critical_threshold
 
All parameters are required.
 
Example:
nagios-server# /usr/lib/nagios/plugins/ai_rt.pl -H 192.168.0.100 -c public -W 700 -C 1100
Status: OK – Response time is 26 msec
nagios-server#
 
Warning and critical are defined as milliseconds.
ai_ocr.pl
Plugin checks the aiScaler caching ratio (OCR).
 
Usage:
/usr/lib/nagios/plugins/ai_ocr.pl -H aiScaler_hostname -c SNMP_community_name -W warning_threshold -C critical_threshold
 
All parameters are required.
 
Example:
nagios-server# /usr/lib/nagios/plugins/ai_ocr.pl -H 192.168.0.100 -c public -W 15 -C 7
Status: OK – OCR caching ratio: 24 percent
nagios-server#
 
Warning and critical are defined as percentage.
ai_scr.pl
Plugin checks the aiScaler caching ratio (SCR).
 
Usage:
/usr/lib/nagios/plugins/ai_scr.pl -H aiScaler_hostname -c SNMP_community_name -W warning_threshold -C critical_threshold
 
All parameters are required.
 
Example:
nagios-server# /usr/lib/nagios/plugins/ai_scr.pl -H 192.168.0.100 -c public -W 15 -C 7
Status: WARNING – OCR caching ratio:  12 percent
nagios-server# 
 
Warning and critical are defined as percentage.
ai_origin_health.pl
Plugin checks the aiScaler origin servers health
 
Usage:
/usr/lib/nagios/plugins/ai_origin_health.pl -H aiScaler_hostname -c SNMP_community_name -W warning_threshold -C critical_threshold
 
Parameters -W (warning threshold) and -C (critical threshold) are optional, but should ONLY be omitted when you are running just one origin server behind aiScaler. In all other cases, please use both -W and -C parameters.
 
Example:
nagios-server# /usr/lib/nagios/plugins/ai_origin_health.pl -H 192.168.0.100 -c public -W 2 -C 1
Status: OK – Number of origin servers: 4 Number of admin disabled origin servers: 0
nagios-server# 
 
Warning and critical are defined as percentage.

aiScaler monitoring configuration

Create and edit the aiScaler host template file: /etc/nagios3/conf.d/aicache_nagios2.cfg
The file should look like the one below:
define host {
use                     aiScaler-host
host_name               aiScaler
alias                   aiScaler
address                 192.168.0.100
}
define service {
useaiCache-service
host_name              
aiCache
service_description     Response time
check_command           ai_rt!public!700!1100
}
define service {
use                     
aiCache-service
host_name               
aiCache
service_description     OCR caching ratio
check_command           ai_ocr!public!15!7
}
define service {
use                     
aiCache-service
host_name               
aiCache
service_description     SCR caching ratio
check_command           ai_scr!public!15!7
}
define service {
use                     
aiCache-service
host_name               
aiCache
service_description     Origin health
check_command           ai_origin_health!public!2!1
}
# In case you are running only one origin server behind aiScaler, replace the last service definition with the following:define service {
use                     
aiCache-service
host_name               
aiCache
service_description     Origin health
check_command           ai_origin_health_single!public
}

aiScaler Nagios screenshot

 

 

Below you can download your Perl scripts

ai_ocr.pl
ai_origin_health.pl
ai_rt.pl
ai_scr.pl
utils.pm
US 1 (408) 744-6078   EU +44 20 7993 4587