Skip to main content

Agentless openstack monitoring using zabbix

Zabbix can be a tough cookie to crack!! And if you are planning to monitor Openstack using Zabbix, there is lot of additional work to be done .More so, if you want to go the agentless way, ie using SNMP

So, here we go.I am using Ubuntu 12.04 OS, both for my Zabbix server as well as openstack nodes

  • First you need to install the following packages using apt-get in the machine being monitored ie the openstack node




apt-get install snmpd
apt-get install snmp snmp-mibs-downloader

  • snmpd will be installed by default in your zabbix server, but you need to install the snmp and snmp-mibs-downloader packages as well in the server
  •  Once that is done, edit the /etc/snmp/snmpd.conf file in your openstack node. Update the following values
agentAddress udp:161,udp6:[::1]:161
rocommunity public <Ip of your zabbix server>
proc  apache2
proc  neutron-server
proc  nova-api

PS: the process names will depend on the openstack node. Name all the processes that you want to monitor

  • Create the openstack host in the Zabbix server, select snmp interface during the host creation
  • By default zabbix has snmp templates for monitoring disk space , cpu utilization, network interface status and  system uptime. You can attach those template to your host
  • Inorder to monitor memory of system using SNMP, we can make us eof the following OIDs to create new templates
Memory Statistics:
Total Swap Size: .1.3.6.1.4.1.2021.4.3.0
Available Swap Space: .1.3.6.1.4.1.2021.4.4.0
Total RAM in machine: .1.3.6.1.4.1.2021.4.5.0
Total RAM used: .1.3.6.1.4.1.2021.4.6.0
Total RAM Free: .1.3.6.1.4.1.2021.4.11.0
Total RAM Shared: .1.3.6.1.4.1.2021.4.13.0
Total RAM Buffered: .1.3.6.1.4.1.2021.4.14.0
Total Cached Memory: .1.3.6.1.4.1.2021.4.15.0

  • For eg, if you want to monitor the total RAM used, first execute the following command from the zabbix server
 snmpwalk -v 2c -c public <openstack node ip> .1.3.6.1.4.1.2021.4.6.0

You will be getting an output which will look like this]

UCD-SNMP-MIB::memAvailReal.0 = INTEGER: 2420936 kB

In this case memAvailReal.0 is the value you should be using for SNMP OID value in the next step
  • You can clone any of the existing SNMP templates, and create new items . You will have to update the 'key' and 'SNMP OID' value in the new item based on the above output. The Key can be any unique value, make sure that the OIDs match the value mentioned in above step
  • In case you want to monitor a process via snmp, as mentioned earlier, it should be defined on the machine's snmpd.conf. Now execute the following command from the zabbix server 

 snmpwalk -v 2c -c public <openstack node ip> prTable 
  • Output should look something like this


UCD-SNMP-MIB::prNames.1 = STRING: mountd
UCD-SNMP-MIB::prNames.2 = STRING: ntalkd
UCD-SNMP-MIB::prNames.3 = STRING: sendmail
UCD-SNMP-MIB::prNames.4 = STRING: /usr/bin/nova-api
UCD-SNMP-MIB::prNames.5 = STRING: apache2
UCD-SNMP-MIB::prNames.6 = STRING: neutron-server
UCD-SNMP-MIB::prNames.7 = STRING: nova-api
......
UCD-SNMP-MIB::prErrorFlag.1 = INTEGER: error(1)
UCD-SNMP-MIB::prErrorFlag.2 = INTEGER: noError(0)
UCD-SNMP-MIB::prErrorFlag.3 = INTEGER: error(1)
UCD-SNMP-MIB::prErrorFlag.4 = INTEGER: error(1)
UCD-SNMP-MIB::prErrorFlag.5 = INTEGER: noError(0)
UCD-SNMP-MIB::prErrorFlag.6 = INTEGER: noError(0)
UCD-SNMP-MIB::prErrorFlag.7 = INTEGER: noError(0)
 

Note the prErrorFlag.n field. We will be using this as SNMP OID in the template for process monitoring. The logic to be used, as clear from the output above is that, if the process is up and running the output will be noError(0)












Comments

Popular posts from this blog

Install nested KVM in VMware ESXi 5.1

In this blog, I will explain the steps required to run a nested KVM hypervisor on  Vmware ESXi. The installation of KVM is done on Ubuntu 13.10(64 bit). Note: It is assumed that you have already installed your Ubuntu 13.10 VM in ESXi, and hence we will not look into the Ubuntu installation part. 1) Upgrade VM Hardware version to 9. In my ESXi server, the default VM hardware version was 8. So I had to shutdown my VM and upgrade the Hardware version to 9 to get the KVM hypervisor working. You can right click the VM and select the Upgrade hardware option to do this. 2)In the ESXi host In /etc/vmware edit the 'config' file and add the following setting vhv.enable = "TRUE" 3)Edit the VM settings and go to VM settings > Options  > CPU/MMU Virtualization . Select the Intel EPT option 4) Go to Options->CPUID mask> Advanced-> Level 1, add the following CPU mask level ECX  ---- ---- ---- ---- ---- ---- --H- ---- 5) Open the vmx...

Virtual fibre channel in Hyper V

Virtual fibre channel option in Hyper V allows the connection to pass through from physical  fibre channel HBA to virtual fibre channel HBA, and still have the flexibilities like live migration. Pre-requisites: VM should be running Windows Server 2008, 2008 R2 or Windows Server 2012 Supported physical HBA with N_Port Virtualization(NPIV) enabled in the HBA. This can be enabled using any management utility provided by the SAN manufacturer. If you need to enable live migration, each host should be having two physical HBAs and each HBA should have two World Wide Names(WWN). WWN is used to established connectivity to FC storage.When you perform migration, the second node can use the second WWN to connect to the storage and then the first node can release its connection. Thereby the storage connectivity is maintained during live migration Configuring virtual fibre channel is a two step process Step 1: Create a Virtual SAN in the Hyper-V host First you need to click on Vir...

The Cloud Migration Gotchas..

All leading cloud providers have a well defined Cloud Adoption Framework that will help you shape up your cloud migration strategy. Customers would eventually end up with one of the 5 'R's of rationalization - Rehost(Lift&shift) , Refactor, Rearchitect, Rebuild or Replace.  Once you have identified the approach , next steps would be planning and execution. However the best  plans laid out by  a professional services team can be driven off the track by  customer specific environment challenges. If you are helping customers with cloud migration, here are few things that you might want to think through again and prepare for before you go all in . 1.Start with stakeholder buy in The first step called out in Azure Cloud Adoption Framework is Strategy  or rather the motivation of the organization to move to cloud. Though this would usually be done in the presales phase and might have the buy in of the C-Suite, it is very important that this acceptance trickles do...