EMC CLARiiON Monitoring – Adding TCP port variable

Modified check_emc_clariion.pl script to specify a different (variable) TCP port for EMC CLARiiON monitoring via Nagios, Cacti, or otherwise.


I’ve been using the check_emc_clariion.pl script for a while to monitor an EMC CLARiiON SAN, but recent issues made me realize the need to use the same check for another host. The problem is the hosts are behind a firewall and using port forwarding – fine for one host on the default port (17894), but I needed to specify a different TCP port to use for the new host.

I updated the check_emc_clariion.pl script to include a TCP port variable, for use like so:

root@host:~#/usr/lib/nagios/plugins/check_emc_clariion.pl -H -u user -p password -t faults --warn 50 --crit 70 --tcp_port=17895
The array is operating normally.

Here is a diff of the original script and my changes:

< $opt_tcp_port 214,217d212 < my $opt_tcp_port = ''; < < ### set tcp port < $opt_tcp_port=17894; 272,273c267 < 'paths=s' => $opt_pathcount,
< 'tcp_port=s' => $opt_tcp_port
> 'paths=s' => $opt_pathcount
< open( NAVICLIOUT, "$NAVICLI_CMD -h $opt_host -Port $opt_tcp_port Faults -list |" ); --- > open( NAVICLIOUT, "$NAVICLI_CMD -h $opt_host -Port 17894 Faults -list |" );

EMC CLARiiON - Nagios

EMC CARiiON - Status Detail

EMC CLARiiON - Cacti graph


Cacti – Using custom templates

Cacti is an awesome tool, but what really makes it fun is importing templates to graph different kinds of data. Here’s a list of custom templates, and there are a lot more out there…

Each one might vary a bit on how it is imported (perl script added to /cacti/scripts, etc.) but the basic ones simply require a .xml to be imported right from the web interface.

Here’s an example of the Cisco 800 series ADSL template:

Cacti Graph - Cisco 857 DSL info



Basic Monitoring w/ Cacti – Configuring SNMP on various types of hosts

Cacti graphs network traffic, disk space, processes, logged in users, and just about anything else you can think of. Here are the basics of configuring SNMP on hosts that you want to monitor with Cacti.

Linux Hosts
Install net-snmp, edit snmpd.conf, edit iptables to allow udp 161 (udp 161 is the Cacti default, allow whatever port you’re using)

Cisco Devices
snmp-server community communitystring
TechRepublic has more details.

Windows Hosts
1) Install SNMP (you may need your Windows install media)
Add/remove Programs > Add/remove Windows Components > Networking Components
2) Configure SNMP in Administrative Tools > Services > SNMP Properties. Set the service to start automatically, and create a community name/trap destination on the ‘Traps’ tab.
3) Allow SNMP through any existing firewalls/AV applications. Windows Firewall only needs to have UDP 161 open, if Cacti is set to ICMP pings.

Miscellaneous Network Devices – (AP’s, switches, etc.)
Most devices allow SNMP configuration through the web interface, if they have one – Punch in the community name and trap destination and you should be set.



Installing Cacti via yum

A super-quick Cacti install using yum (as performed on a CentOS 5 LAMP server):

1) Use a DAG repository

2) Install Cacti along with the dependencies (net-snmp-utils, etc):
yum install cacti

3) Create a DB for Cacti:
mysql>create database cacti;
mysql>GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'cactidbpasswd';
mysql>flush privileges;

4) Move cacti directory to apache root (if necessary):
cd /var/www/
mv cacti/ html/

5) Edit /etc/httpd/conf.d/cacti.conf to include to correct directory and allow access to the web interface from select hosts.

6) Make the DB connection by editing a Cacti config file:
vi html/cacti/include/config.php

7) Browse to the web interface (http://yourserver/cacti) and go through the initial setup!

The default Cacti username and password is admin. You’ll be required to change the password after the initial login.