Use Cacti to monitor your network latency

3 02 2008

If you are managing and monitoring a network you will probably be interested to keep an eye on the latency of your network links. Especially for those links which are connected with a dedicated internet connection and a IPSec VPN tunnel to the datacenter. Latency is predictable but for non private IP VPN links without reserved bandwidth and QoS/CoS it sometimes may help solve some problems or rethink and discuss high latency with the service provider. With dedicated Framerelay/Leased Line/IP VPN network links you can agree with the service provider on the different latency values and have SLA’s in place.

Latency in a packet-switched network is measured either one-way (the time from the source sending a packet to the destination receiving it), or round-trip (the one-way latency from source to destination plus the one-way latency from the destination back to the source). Round-trip latency is more often quoted, because it can be measured from a single point. Note that round trip latency excludes the amount of time that a destination system spends processing the packet. Many software platforms provide a service called ping that can be used to measure round-trip latency. Ping performs no packet processing; it merely sends a response back when it receives a packet (i.e. performs a no-op), thus it is a relatively accurate way of measuring latency.

http://en.wikipedia.org/wiki/Latency_%28engineering%29

I am using CactiEZ v0.3 to address this issue and monitor the ping latency. Those hosts may or may not be a SNMP enabled device. If the router is service provider managed than you probably won’t be able to get any access to SNMP, but for this we don’t need it.

a) Create new device in Cacti Management console. See example for www.networknet.nl

image

b) Choose for Availability “Ping” and use “ICMP” ping as method. Click Add and reopen the device.

c) Locate Associated Graph Templates and choose “Unix-Ping Latency” in the Graph Templates. Click Add.

image

d) Click “*Create Graphs for this Host”

e) Select “Create: Unix - Ping Latency” graph template and click Create.

f) Choose Red as legend color and click Create. + Created graph: www.networknet.nl - Ping Latency is now created.

i) Create new Graph Tree and add the new created graph for the network latency. See my example.

image

The result:

image



CentOS Cacti Appliance (CactiEZ) and snmp configuration

8 01 2008

I am running CactiEZ VMWare appliance for a while and couple of graphs I was looking for were not integrated in the SNMP configuration.

CactiEZ is based on CentOS linux distribution.

Verify SNMP Daemon is running

[root@CACTI-04 /]# ps -ef | grep snmp
root 29283 1 0 Jan06 ? 00:00:00 /usr/sbin/snmpd -Lsd -Lf /dev/null -p /var/run/snmpd -a
[root@CACTI-04 /]#

Rename the default configuration file

[root@CACTI-04 /]# mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.org
[root@CACTI-04 /]# ls /etc/snmp/
snmpd.org
[root@CACTI-04 /]#

Create new file with your own SNMP configuration

[root@CACTI-04 /]# vi /etc/snmp/snmpd.conf
###########################################################################
#
# snmpd.conf
#
# - created by the snmpconf configuration program
#
###########################################################################
# SECTION: System Information Setup
#
# This section defines some of the information reported in
# the “system” mib group in the mibII tree.
# syslocation: The [typically physical] location of the system.
# Note that setting this value here means that when trying to
# perform an snmp SET operation to the sysLocation.0 variable will make
# the agent return the “notWritable” error code. IE, including
# this token in the snmpd.conf file will disable write access to
# the variable.
# arguments: location_string

syslocation NETWORKNET
# syscontact: The contact information for the administrator
# Note that setting this value here means that when trying to
# perform an snmp SET operation to the sysContact.0 variable will make
# the agent return the “notWritable” error code. IE, including
# this token in the snmpd.conf file will disable write access to
# the variable.
# arguments: contact_string

syscontact Ivan Versluis
###########################################################################
# SECTION: Access Control Setup
#
# This section defines who is allowed to talk to your running
# snmp agent.
# rocommunity: a SNMPv1/SNMPv2c read-only access community name
# arguments: community [default|hostname|network/bits] [oid]

rocommunity net_ro_public
###########################################################################
# SECTION: Agent Operating Mode
#
# This section defines how the agent will operate when it
# is running.
# agentaddress: The IP address and port number that the agent will listen on.
# By default the agent listens to any and all traffic from any
# interface on the default SNMP port (161). This allows you to
# specify which address, interface, transport type and port(s) that you
# want the agent to listen on. Multiple definitions of this token
# are concatenated together (using ‘:’s).
# arguments: [transport:]port[@interface/address],…

agentaddress 127.0.0.1:161

ESC and :wq! to save and exit the file.

Reload the snmpd.conf file and verify the SNMP configuration with snmpread

[root@CACTI-04 /]# service snmpd reload

Reloading snmpd: [ OK ]

[root@CACTI-04 /]#

Open the Cacti Devices and choose to add new host.

 

clip_image002

After new device has been added and the new CentOS device is being reopened the device should show the SNMP configuration like mine.

CACTI-04 (127.0.0.1)

SNMP Information
System: Linux CACTI-04.almatis.internal 2.6.9-34.EL #1 Wed Mar 8 00:07:35 CST 2006 i686
Uptime: 12822505
Hostname: CACTI-04.networknet.nl
Location: NETWORKNET
Contact: Ivan Versluis

Last step would be to create new graps. Depending on the host template choosen cpu, memory and nic graps can be created.

NIC

clip_image004

CPU

clip_image006

Memory

clip_image008



CentOS how to install VMWare tools?

21 11 2007

Mount the iso image on the VMWare guest running the CentOS partition.

The iso file can be found C:\Program Files\VMware\VMware Server\linux.iso if you are running VMWare Server instance.

2007-11-21_155629

Login with VMWare Server Console to CentOS and mount the cdrom

  • mkdir /mnt/cdrom 
  • mount /dev/cdrom /mnt/cdrom 

mount: block device /dev/cdrom is write-protected, mounting read-only

Mount will link the cdrom to the  /mnt/cdrom directory.  Now you can copy the rpm file to /tmp and start the installation process.

  • cp /mnt/cdrom/VMwareTools-1.0.2-39867.i386.rpm /tmp
  • cd /tmp
  • rpm -i /tmp/VMwareTools-1.0.2-39867.i386.rpm

After the file has been installed start the vmware tools perl script

  • vmware-config-tools.pl