Configure SNMP on Citrix XenServer 6.x

I love Cacti and use it all the time to monitor my system performance.  Here are the few steps needed to turn SNMP on with in your Citrix XenServer hosts.  This document assumes you already have Performance Monitoring Enhancements Pack for XenServer, SNMP, and Cacti already installed and functioning on your network.

  1. Edit: /etc/sysconfig/iptables
    Add the following lines AFTER the line “-A RH-Firewall-1-INPUT -p udp –dport 5353 -d 224.0.0.251 -j ACCEPT”
    -A RH-Firewall-1-INPUT -p udp --dport 161 -j ACCEPT
    -A RH-Firewall-1-INPUT -p udp --dport 162 -j ACCEPT
  2. Execute: service iptables restart
  3. Edit: /etc/snmp/snmpd.conf
    Replace the community with your current SNMP community if you have one.
    # sec.name source community
    com2sec notConfigUser default public
  4. Execute: chkconfig snmpd on
  5. Execute: service snmpd restart
  6. Test from another host: snmpwalk -v 2c -c public xenserver.someplace.com
    Note, replace public with your SNMP community!

Install Dell Openmanage on Citrix XenServer for Nagios checks

Like any good sysadmin, you want to know if anything is happening to your Dell hardware at any given moment.  Here is what I did to get Dell Openmanage installed in Citrix XenServer 5.6, 6.0, and 6.1.    Once openmanage is installed and working, you can then have Nagios ssh into the Xenserver host and run a check (this maybe covered in another post).

  1. I now send you on a quest.  Head to the dell website and start searching for the software.  Get something named “Dell OpenManage Server Administrator Managed Node (Distribution Specific)” or also called “OpenManage Supplemental Pack” or “OpenManage Server Administrator Managed Node” or “OM-SrvAdmin-Dell-Web-LX-7.1.0-5304.XenServer60_A00.iso” or this link?
  2. Transfer the iso to your xenserver host via scp.
  3. mount –o loop <openmanange-supplemental-pack-filename>.iso /mnt
  4. cd /mnt
  5. ./install.sh
  6. /etc/init.d/dataeng start
  7. Logout and back in and this command should work:
    omreport storage pdisk controller=0
  8. /usr/sbin/useradd nagios
  9. passwd nagios
  10. cd /home/nagios
  11. mkdir .ssh
  12. Now we need to generate or install a ssh key for Nagios to login without a password.  Here is how you would generate one:
    ssh-keygen -t dsa -b 1024 -f .ssh/id_dsa
    cat .ssh/id_dsa.pub >> .ssh/authorized_keys
  13. chown -R nagios:nagios .ssh
  14. chmod 750 .ssh
  15. chmod 640 .ssh/*
  16. mkdir bin
  17. chown -R nagios:nagios bin
  18. chmod 750 bin
  19. Get the nagios check script, this will be excuted by Nagios when it logins via ssh
    wget http://folk.uio.no/trondham/software/files/check_openmanage-3.7.3.tar.gz
  20. tar -xzvf check_openmanage-3.7.3.tar.gz
  21. cp check_openmanage-3.7.3/check_openmanage bin/
  22. If you are running Xenserver 6 or higher, you will need to run this command
    chmod o+rx /
  23. Log into your Nagios server
  24. Copy ssh id_dsa/.pub to nagios server, in nagios’s ~/.ssh
  25. Test logging in without a password
  26. Setup nagios checks (I plan posting this someone day)

Helpful links: