SlideShare a Scribd company logo
1 of 38
Monitoring Openstack – 
The Relationship Between Nagios and Ceilometer 
Konstantin Benz, 
Researcher 
@ Zurich University of Applied Sciences 
benn@zhaw.ch
Introduction & Agenda 
•About me 
•Working as researcher @ 
Zurich University of Applied Sciences 
•OpenStack / Cloud Computing 
•Engaged in monitoring and High Availability systems 
•Currently working on a Europe-wide cloud federation: 
•XIFI – eXtensible Infrastructure for Future Internet 
http://www.fi-xifi.eu 
•17 nodes / OpenStack clouds 
•Test environment for Future Internet (FI-WARE) 
applications 
•Infrastructure for smart cities, public healthcare, traffic 
management… 
•European-wide L2-connected backbone network 
•Nagios as main monitoring tool of that project
Introduction & Agenda 
•What are you talking about in this presentation? 
• How to use Nagios to monitor an OpenStack cloud environment 
• Integrate Nagios with OpenStack 
•Anything else? 
• Cloud monitoring requirements 
• OpenStack cloud management software and Ceilometer 
• Comparison between Nagios and Ceilometer: 
• Technological paradigms 
• Commonalities and differences 
• How to integrate Nagios with Ceilometer 
•Can't wait!
Cloud Monitoring Requirements 
Cloud ≈ virtualization + elasticity 
•Types of clouds: 
• IaaS: virtual VMs and network devices, elasticity in number/size of devices 
• PaaS: virtual, elastically sized platform 
• SaaS: software provided by employing virtual, elastic resources 
•Cloud is a collection of virtual resources provided in physical 
infrastructure 
•Cloud provides resources elastically
Cloud Monitoring Requirements 
Why should someone use clouds? 
•Cloud consumer can outsource IT infrastructure 
• No fixed costs for cloud consumer 
• Pay for resource utilization 
• Cloud provider responsible for building and maintaining physical 
infrastructure 
•Cloud provider can rent out unused IT infrastructure 
• Eliminate waste 
• Get money back for overcapacity
Monitoring OpenStack 
OpenStack 
Architecture 
•Open source cloud computing software 
•Consists in multiple services: 
• Keystone: OpenStack identity services 
(authentication, authorization, accounting) 
• Cinder: management of block storage volumes 
• Nova: management and provision of virtual resources 
(VM instances) 
• Glance: management of VM images 
• Swift: management of object storage 
• Neutron: management of network resources (IPs, 
routing, connectivity) 
• Horizon: GUI dashboard for end users 
• Heat: orchestration of virtualized environments 
(important for providing elasticity) 
• Ceilometer: monitoring of virtual resources
Monitoring OpenStack 
Things to monitor 
•Operation of OpenStack itself: 
• Services: Cinder, Glance, Nova, Swift ... 
• Infrastructure: Hardware, Operating System where OpenStack services are running 
•Operation of virtual resources provided by OpenStack: 
• Resource availability: VMs, virtual network devices 
• Resource utilization: VM uptime, CPU / memory usage 
→ Virtual resources are commonly monitored by Ceilometer 
→ Ceilometer gathers data 
through the API of 
OpenStack services
Monitoring OpenStack 
Why is Ceilometer not enough? 
→ Ceilometer monitors virtual resources through APIs of OpenStack 
components, BUT NOT operation of the OpenStack components
Comparison Nagios / Ceilometer 
Nagios operational model 
•Configuration: 
• Check interval (and retry interval) to poll system status and update frontend GUI 
• Remote execution of monitoring clients (usually Nagios plugins) 
• Thresholds that result in "Okay", "Warning", "Critical" status messages which are sent back to 
Nagios server (and "Unknown" if status not measurable) 
Main usage: 
• Effective monitoring solution for physical servers 
• System administration console that allows for fast reaction in case of problems 
• Strength: extensibility and customizability 
• Nagios must be extended in order to monitor virtual resources inside administrated systems
Comparison Nagios / Ceilometer 
Ceilometer operational model 
•Configuration: 
• Polling services check metrics 
• OpenStack objects generate event notifications automatically 
• All events and metrics collected in a database 
Main usage: 
• OpenStack integrated metrics collector and database 
• Temporal database that can be used for rating, charging and billing of virtual resource 
utilization 
• Strength: fully integrated in OpenStack, collecting most important metrics and storing their 
change history 
• Weakness: Does not monitor physical hosts
Nagios / OpenStack Integration 
Alternative 1: Ceilometer Plugin in Nagios 
•Use Nagios server as frontend for Ceilometer: 
• Nagios plugin that queries Ceilometer database 
• Virtual resource utilization data collected by Ceilometer 
• Nagios server responsible for monitoring non-virtual resources 
Benefits: 
• Simple and easy to implement 
• No extra Nagios plugins required to monitor virtual devices that are managed within OpenStack 
• Ceilometer tool can be left unchanged 
Drawbacks: 
• Monitoring data is stored at 2 different places: Nagios flat file and Ceilometer database
Nagios / OpenStack Integration 
Alternative 1: Ceilometer Plugin in Nagios 
•Implementation: 
• Nagios plugin on client which hosts the Ceilometer API (code sample below) 
• Initialization with default values, OpenStack authentication: 
#!/bin/bash 
#initialization with default values 
SERVICE='cpu_util' 
THRESHOLD='50.0' 
CRITICAL_THRESHOLD='80.0' 
#get openstack token to access ceilometer-api 
export OS_USERNAME="youruser" 
export OS_TENANT_NAME="yourtenant" 
export OS_PASSWORD="yourpassword" 
export OS_AUTH_URL=http://yourkeystoneurl:35357/v2.0/
Nagios / OpenStack Integration 
Alternative 1: Ceilometer Plugin in Nagios 
•The plugin should receive paramaters for: 
• Resource to be monitored (VM) 
• Service (Ceilometer metric) 
• Warning threshold 
• Critical threshold 
while getopts ":hs:t:T:" opt 
do 
case $opt in 
h ) printusage;; 
r ) RESOURCE=${OPTARG};; 
s ) SERVICE=${OPTARG};; 
t ) THRESHOLD=${OPTARG};; 
T ) CRITICAL_THRESHOLD=${OPTARG};; 
? ) printusage;; 
esac 
done
Nagios / OpenStack Integration 
Alternative 1: Ceilometer Plugin in Nagios 
•Query Nova API to get resource to monitor (VM to be monitored): 
RESOURCE=$(nova list | grep $RESOURCE | tail -2 | head -1 | awk -F '|' '{print $2; end}') 
RESOURCE=$(echo $RESOURCE) 
•Query metric on that resource, multiple entries possible requires an iterator): 
ITERATOR=$(ceilometer meter-list -q "resource_id=$RESOURCE" | grep -w $SERVICE | awk 
'END{print NR; end}') 
•Initialize with return code 0 (no warning or error): 
RETURNCODE=0
Nagios / OpenStack Integration 
Alternative 1: Ceilometer Plugin in Nagios 
•Iterate through metric: 
for (( C=1; C<=$ITERATOR; C++ )) 
do 
METER_NAME=$(ceilometer meter-list -q "resource_id=$RESOURCE" | grep -w $SERVICE | 
awk -F '|' -v var="$C" '{if (NR == var) {print $2 $1; end}}') 
METER_UNIT=$(ceilometer meter-list -q "resource_id=$RESOURCE" | grep -w $SERVICE | awk 
-F '|' -v var="$C" '{if (NR == var) {print $4 $1; end}}') 
RESOURCE_ID=$(ceilometer meter-list -q "resource_id=$RESOURCE" | grep -w $SERVICE | 
awk -F '|' -v var="$C" '{if (NR == var) {print $5 $1; end}}') 
ACTUAL_VALUE=$(ceilometer sample-list -m $METER_NAME -q "resource_id=$RESOURCE" -l 
1 | grep $RESOURCE_ID | head -4 | tail -1| awk -F '|' '{print $5; end}')
Nagios / OpenStack Integration 
Alternative 1: Ceilometer Plugin in Nagios 
•Update return code if value of one metric is above a threshold: 
if [ $(echo "$ACTUAL_VALUE > $THRESHOLD" | bc) -eq 1 ] 
then 
if (( "$RETURNCODE" < "1" )) 
then 
RETURNCODE=1 
fi 
if [ $(echo "$ACTUAL_VALUE > $CRITICAL_THRESHOLD" | bc) -eq 1 ] 
then 
if (( "$RETURNCODE" < "2" )) 
then 
RETURNCODE=2
Nagios / OpenStack Integration 
Alternative 1: Ceilometer Plugin in Nagios 
•Output return code: 
STATUS=$(echo "$METER_NAME on $RESOURCE_ID is: $ACTUAL_VALUE $METER_UNIT") 
echo $STATUS 
done 
echo $RETURNCODE
Nagios / OpenStack Integration 
Alternative 1: Ceilometer Plugin in Nagios 
•Plugin can be downloaded from Github: 
• https://github.com/kobe6661/nagios_ceilometer_plugin.git 
•Additionally: 
• NRPE-Plugin: remote execution of Nagios calls to Ceilometer 
• Install NRPE on Nagios Core server and server that hosts Ceilometer API 
• Change nrpe.cfg to include call to VM metric
Nagios / OpenStack Integration 
Alternative 1: Implementation 
•OpenStack installed on 3 nodes: 
• Management node: responsible for monitoring other OpenStack nodes 
• Controller node: responsible for management and configuration of cloud resources (VMs, network) 
• Compute node: provisions virtual resources
Nagios / OpenStack Integration 
Alternative 2: Nagios OpenStack Plugins 
•Nagios as a tool to monitor OpenStack services and VMs: 
• Plugins to monitor health of OpenStack services 
• As soon as new VMs are created, Nagios should monitor them 
• Requires elastic reconfiguration of Nagios 
Benefits: 
• No data duplication, Nagios is the only monitoring tool required to monitor OpenStack 
Drawbacks: 
• Elastic reconfiguration 
• Rather complex Nagios configuration
Nagios / OpenStack Integration 
Alternative 2: Nagios OpenStack Plugins 
•Problem: 
• Dynamic provisioning of resources (Virtual Machines) 
• Dynamic configuration of hosts in Nagios Server required 
PROVIDES 
OpenStack 
Compute 
Node 
Virtual Machine 
OpenStack 
Controller 
Node 
MONITORS 
Nagios 
Server 
VM Image
Nagios / OpenStack Integration 
Alternative 2: Nagios OpenStack Plugins 
•Problem: 
• What happens if VM is terminated by end user? 
• Nagios assumes a host failure and produces a critical warning 
PROVIDES 
OpenStack 
Compute 
Node 
Virtual Machine 
OpenStack 
Controller 
Node 
MONITORS 
Nagios 
Server 
VM Image
Nagios / OpenStack Integration 
Alternative 2: Nagios OpenStack Plugins 
•Solution: 
• Nova-API triggers reconfiguration of Nagios if VMs are created or terminated 
PROVIDES 
OpenStack 
Compute 
Node 
Virtual Machine 
OpenStack 
Controller 
Node 
Nagios 
Server 
VM Image 
RECONFIGURES
Nagios / OpenStack Integration 
Alternative 2: Nagios OpenStack Plugins 
•Another problem: 
• VMs must have Nagios plugins installed when they are created 
•Solution: 
• Use only VM Images that contain Nagios plugins for VM creation OR 
• Use package management tools like Puppet, Chef… 
PROVIDES 
OpenStack 
Compute 
Node 
Virtual Machine 
OpenStack 
Controller 
Node 
Nagios 
Server 
NRPE Plugins 
VM Image 
NRPE Plugins
Nagios / OpenStack Integration 
Alternative 2: Nagios OpenStack Plugins 
•Trigger for dynamic Nagios configuration: 
• Find available resources via nova-api (requires name of host and IP address) 
#!/bin/bash 
NUMLINES=$(nova list | wc -l) 
NUMLINES=$[$NUMLINES-3] 
for (( C=1; C<=$ITERATOR; C++ )) 
do 
VM_NAME=$(nova list | tail -$NUMLINES | awk -F'|' -v var="$I" '{if (NR==var){print $3 $1;end}}') 
IP_ADDRESS=$(nova list | tail -$NUMLINES | awk -F'|' -v var="$I" '{if (NR==var){print $7 $1;end}}' 
| sed 's/[a-zA-Z0-9]*[=|-]//g')
Nagios / OpenStack Integration 
Alternative 2: Nagios OpenStack Plugins 
•Trigger for dynamic Nagios configuration: 
• Create a config file including VM name and IP address from a template (e. g. vm_template.cfg) 
CONFIG_FILE=$(echo $VM_NAME).cfg 
sed "s/<vm_name>/$VM_NAME/g" vm_template.cfg>named_template.cfg 
sed "s/<ip_address>/$IP_ADDRESS/g" named_template.cfg>$CONFIG_FILE 
• Set Nagios as owner of the file and move file to Nagios configuration directory 
chown nagios.nagios $CONFIG_FILE 
chmod 644 $CONFIG_FILE 
mv $CONFIG_FILE /usr/local/nagios/etc/objects/$CONFIG_FILE
Nagios / OpenStack Integration 
Alternative 2: Nagios OpenStack Plugins 
•Trigger for dynamic Nagios configuration: 
• Add config file to nagios.cfg 
echo "cfg_file=/usr/local/nagios/etc/objects/$CONFIG_FILE" >> /usr/local/nagios/etc/nagios.cfg 
• Restart nagios 
service nagios restart
Nagios / OpenStack Integration 
Alternative 2: Nagios OpenStack Plugins 
•Why restart Nagios? 
• Nagios must know that a new VM is present or that an old VM has been terminated 
• Reconfigure and restart Nagios (!)
Nagios / OpenStack Integration 
Alternative 2: Nagios OpenStack Plugins 
•Trigger for dynamic Nagios configuration: 
• Add trigger to Nova-API: 
• Nagios Event Broker module: 
• Check_MK: http://mathias-kettner.de/checkmk_livestatus.html 
• Reconfigure Nagios dynamically: 
• Edit nagios.cfg and restart Nagios – bad idea (!!) in a cloud environment 
• Autoconfiguration tools: 
• NagioSQL: http://www.nagiosql.org/documentation.html
Nagios / OpenStack Integration 
Alternative 2: Nagios OpenStack Plugins 
•What other ways do exist to dynamically reconfigure Nagios? 
• Puppet master that triggers: 
• VMs to install Nagios NRPE plugins and 
• Nagios Server to update its configuration 
• Same can be done with Chef, Ansible… 
• Drawback: 
Puppet scalability if 1‘000s of servers have to be (de-)commisioned dynamically
Nagios / OpenStack Integration 
Alternative 2: Nagios OpenStack Plugins 
•What other ways do exist to dynamically reconfigure Nagios? 
• Python fabric with Cuisine to trigger: 
• VMs to install Nagios NRPE plugins and 
• Nagios Server to update its configuration 
• Get list of VMs 
from novaclient.client import Client 
nova = Client(VERSION, USERNAME, PASSWORD, PROJECT_ID, AUTH_URL) 
servers = nova.servers.list() 
• Write VM list to file 
file = open('servers'‚ 'w') 
file.write(servers)
Nagios / OpenStack Integration 
Alternative 2: Nagios OpenStack Plugins 
•What other ways do exist to dynamically reconfigure Nagios? 
• Python fabric with Cuisine to trigger: 
• VMs to install Nagios NRPE plugins and 
• Nagios Server to update its configuration 
• Create fabfile.py and define which servers should be configured 
from fabric.api import * 
from . import vm_recipe, nagios_recipe 
env.use_ssh_config = True 
servers=open('servers‘) 
serverlist=[str(line) for line in servers] 
env.roledefs = {‘vm': serverlist, 
‘nagios_server': xx.xx.xx.xx 
}
Nagios / OpenStack Integration 
Alternative 2: Nagios OpenStack Plugins 
• Assign recipes 
@roles(„vm") 
def configure_vm(): 
vm_recipe.ensure() 
@roles(„nagios") 
def configure_nagios(): 
nagios_recipe.ensure()
Nagios / OpenStack Integration 
Alternative 2: Nagios OpenStack Plugins 
• Create vm_recipe.py and nagios_recipe.py 
from fabric.api import * 
import cuisine 
def ensure(): 
if not is_installed(): 
puts("Installing NRPE...") 
install() 
else: 
puts(„NRPE already installed") 
def install_prerequisites(): 
cuisine.package_ensure(„nrpe")
Choice of Alternatives 
Which option should we choose? 
• Implementation advantages and drawbacks 
Implementation Advantages Drawbacks 
A1: Ceilometer 
collects data 
• Very easy solution 
• Scales well 
• Data duplication 
• Two monitoring systems 
working in parallel 
A2: Shell script • No data duplication 
• Easy solution 
• Difficult to maintain 
• Possibly insecure 
• Nagios is forced to restart 
A2: Puppet • Automatic VM and Nagios 
configuration 
• Allows for elastic 
reconfiguration of Nagios 
• Heavyweight 
• Bad scalability for large IaaS 
clusters 
A2: Python fabric 
& cuisine 
• Lightweight 
• Automatic VM and Nagios 
configuration 
• Allows for elastic 
reconfiguration of Nagios 
• Bigger configuration effort for 
package management with 
strong dependencies between 
packages
Conclusion 
What did you talk about? 
•How to use Nagios to monitor an OpenStack cloud environment 
• Cloud monitoring requirements: 
• Elasticity, dynamic provisioning of virtual machines 
•OpenStack monitoring tools Nagios and Ceilometer 
• Nagios as extensible monitoring system 
• Ceilometer captures data through Nova-API 
•Nagios/OpenStack integration 
• Alternative 1: 
• Ceilometer monitors VMs with Nagios as graphical frontend 
• Alternative 2: 
• Nagios monitors VMs and is automatically reconfigured 
•Discovered need for dynamic reloading of Nagios configuration 
•Discussed advantages/drawbacks of different implementations
Questions? 
Any questions? 
Thanks!
The End 
Konstantin Benz 
benn@zhaw.ch

More Related Content

What's hot

Icinga lsm 2015 copy
Icinga lsm 2015 copyIcinga lsm 2015 copy
Icinga lsm 2015 copy
NETWAYS
 

What's hot (20)

Marcelo Perazolo, Lead Software Architect, IBM Corporation - Monitoring a Pow...
Marcelo Perazolo, Lead Software Architect, IBM Corporation - Monitoring a Pow...Marcelo Perazolo, Lead Software Architect, IBM Corporation - Monitoring a Pow...
Marcelo Perazolo, Lead Software Architect, IBM Corporation - Monitoring a Pow...
 
Why favour Icinga over Nagios @ OSDC 2015
Why favour Icinga over Nagios @ OSDC 2015Why favour Icinga over Nagios @ OSDC 2015
Why favour Icinga over Nagios @ OSDC 2015
 
Nagios Conference 2014 - Dorance Martinez Cortes - Customizing Nagios
Nagios Conference 2014 - Dorance Martinez Cortes - Customizing NagiosNagios Conference 2014 - Dorance Martinez Cortes - Customizing Nagios
Nagios Conference 2014 - Dorance Martinez Cortes - Customizing Nagios
 
Nagios Conference 2014 - Scott Wilkerson - Log Monitoring and Log Management ...
Nagios Conference 2014 - Scott Wilkerson - Log Monitoring and Log Management ...Nagios Conference 2014 - Scott Wilkerson - Log Monitoring and Log Management ...
Nagios Conference 2014 - Scott Wilkerson - Log Monitoring and Log Management ...
 
Icinga @GUUG 2013
Icinga @GUUG 2013Icinga @GUUG 2013
Icinga @GUUG 2013
 
Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.
Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.
Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.
 
Icinga lsm 2015 copy
Icinga lsm 2015 copyIcinga lsm 2015 copy
Icinga lsm 2015 copy
 
Icinga 2011 at Nagios Workshop
Icinga 2011 at Nagios WorkshopIcinga 2011 at Nagios Workshop
Icinga 2011 at Nagios Workshop
 
Bryan Heden - Agile Networks - Using Nagios XI as the platform for Monitoring...
Bryan Heden - Agile Networks - Using Nagios XI as the platform for Monitoring...Bryan Heden - Agile Networks - Using Nagios XI as the platform for Monitoring...
Bryan Heden - Agile Networks - Using Nagios XI as the platform for Monitoring...
 
Icinga 2 API @ Icinga Camp Portland at Puppetlabs
Icinga 2 API @ Icinga Camp Portland at PuppetlabsIcinga 2 API @ Icinga Camp Portland at Puppetlabs
Icinga 2 API @ Icinga Camp Portland at Puppetlabs
 
The Cloud Native Stack
The Cloud Native StackThe Cloud Native Stack
The Cloud Native Stack
 
Icinga @OSMC 2013
Icinga @OSMC 2013Icinga @OSMC 2013
Icinga @OSMC 2013
 
/bin/tails from OpenStack Operations: Rarm Nagalingam, Red Hat
/bin/tails from OpenStack Operations: Rarm Nagalingam, Red Hat/bin/tails from OpenStack Operations: Rarm Nagalingam, Red Hat
/bin/tails from OpenStack Operations: Rarm Nagalingam, Red Hat
 
E2E Data Pipeline - Apache Spark/Airflow/Livy
E2E Data Pipeline - Apache Spark/Airflow/LivyE2E Data Pipeline - Apache Spark/Airflow/Livy
E2E Data Pipeline - Apache Spark/Airflow/Livy
 
Icinga 2 at Icinga Camp San Francisco
Icinga 2 at Icinga Camp San FranciscoIcinga 2 at Icinga Camp San Francisco
Icinga 2 at Icinga Camp San Francisco
 
ChinaNetCloud Online Lecture:Something About Tshark
ChinaNetCloud Online Lecture:Something About TsharkChinaNetCloud Online Lecture:Something About Tshark
ChinaNetCloud Online Lecture:Something About Tshark
 
State of Development - Icinga Meetup Linz August 2019
State of Development - Icinga Meetup Linz August 2019State of Development - Icinga Meetup Linz August 2019
State of Development - Icinga Meetup Linz August 2019
 
Icinga Camp Antwerp - Current State of Icinga
Icinga Camp Antwerp - Current State of IcingaIcinga Camp Antwerp - Current State of Icinga
Icinga Camp Antwerp - Current State of Icinga
 
Nagios Conference 2014 - Andy Brist - Nagios XI Failover and HA Solutions
Nagios Conference 2014 - Andy Brist - Nagios XI Failover and HA SolutionsNagios Conference 2014 - Andy Brist - Nagios XI Failover and HA Solutions
Nagios Conference 2014 - Andy Brist - Nagios XI Failover and HA Solutions
 
OpsStack--Integrated Operation Platform
OpsStack--Integrated Operation PlatformOpsStack--Integrated Operation Platform
OpsStack--Integrated Operation Platform
 

Viewers also liked

Viewers also liked (14)

Jenkins
JenkinsJenkins
Jenkins
 
Nagios, Getting Started.
Nagios, Getting Started.Nagios, Getting Started.
Nagios, Getting Started.
 
Using Nagios with Chef
Using Nagios with ChefUsing Nagios with Chef
Using Nagios with Chef
 
Janice Singh - Writing Custom Nagios Plugins
Janice Singh - Writing Custom Nagios PluginsJanice Singh - Writing Custom Nagios Plugins
Janice Singh - Writing Custom Nagios Plugins
 
Sean Falzon - Nagios - Resilient Notifications
Sean Falzon - Nagios - Resilient NotificationsSean Falzon - Nagios - Resilient Notifications
Sean Falzon - Nagios - Resilient Notifications
 
Dave Williams - Nagios Log Server - Practical Experience
Dave Williams - Nagios Log Server - Practical ExperienceDave Williams - Nagios Log Server - Practical Experience
Dave Williams - Nagios Log Server - Practical Experience
 
Nagios core vs. nagios xi presentation power point.pptx [diperbaiki]
Nagios core vs. nagios xi presentation power point.pptx [diperbaiki]Nagios core vs. nagios xi presentation power point.pptx [diperbaiki]
Nagios core vs. nagios xi presentation power point.pptx [diperbaiki]
 
Trevor McDonald - Nagios XI Under The Hood
Trevor McDonald  - Nagios XI Under The HoodTrevor McDonald  - Nagios XI Under The Hood
Trevor McDonald - Nagios XI Under The Hood
 
Jesse Olson - Nagios Log Server Architecture Overview
Jesse Olson - Nagios Log Server Architecture OverviewJesse Olson - Nagios Log Server Architecture Overview
Jesse Olson - Nagios Log Server Architecture Overview
 
Nagios XI Best Practices
Nagios XI Best PracticesNagios XI Best Practices
Nagios XI Best Practices
 
Monitoring with Nagios and Ganglia
Monitoring with Nagios and GangliaMonitoring with Nagios and Ganglia
Monitoring with Nagios and Ganglia
 
Docker + Kubernetes를 이용한 빌드 서버 가상화 사례
Docker + Kubernetes를 이용한 빌드 서버 가상화 사례Docker + Kubernetes를 이용한 빌드 서버 가상화 사례
Docker + Kubernetes를 이용한 빌드 서버 가상화 사례
 
DEVOPS 에 대한 전반적인 소개 및 자동화툴 소개
DEVOPS 에 대한 전반적인 소개 및 자동화툴 소개DEVOPS 에 대한 전반적인 소개 및 자동화툴 소개
DEVOPS 에 대한 전반적인 소개 및 자동화툴 소개
 
Docker란 무엇인가? : Docker 기본 사용법
Docker란 무엇인가? : Docker 기본 사용법Docker란 무엇인가? : Docker 기본 사용법
Docker란 무엇인가? : Docker 기본 사용법
 

Similar to Nagios Conference 2014 - Konstantin Benz - Monitoring Openstack The Relationship Between Nagios and Ceilometer

Openstack presentation
Openstack presentationOpenstack presentation
Openstack presentation
Sankalp Jain
 
Gordonh0945deepdive openstackcompute-140417174059-phpapp02
Gordonh0945deepdive openstackcompute-140417174059-phpapp02Gordonh0945deepdive openstackcompute-140417174059-phpapp02
Gordonh0945deepdive openstackcompute-140417174059-phpapp02
Công TÔ
 
VMUG22 Filip Verloy VIO
VMUG22 Filip Verloy VIOVMUG22 Filip Verloy VIO
VMUG22 Filip Verloy VIO
Filip Verloy
 

Similar to Nagios Conference 2014 - Konstantin Benz - Monitoring Openstack The Relationship Between Nagios and Ceilometer (20)

Openstack presentation
Openstack presentationOpenstack presentation
Openstack presentation
 
Améliorer OpenStack avec les technologies Intel
Améliorer OpenStack avec les technologies IntelAméliorer OpenStack avec les technologies Intel
Améliorer OpenStack avec les technologies Intel
 
Openstack: starter level
Openstack: starter levelOpenstack: starter level
Openstack: starter level
 
Monitoring kubernetes across data center and cloud
Monitoring kubernetes across data center and cloudMonitoring kubernetes across data center and cloud
Monitoring kubernetes across data center and cloud
 
StackWatch: A prototype CloudWatch service for CloudStack
StackWatch: A prototype CloudWatch service for CloudStackStackWatch: A prototype CloudWatch service for CloudStack
StackWatch: A prototype CloudWatch service for CloudStack
 
Pro2516 10 things about oracle and k8s.pptx-final
Pro2516   10 things about oracle and k8s.pptx-finalPro2516   10 things about oracle and k8s.pptx-final
Pro2516 10 things about oracle and k8s.pptx-final
 
Cloud Architect Alliance #15: Openstack
Cloud Architect Alliance #15: OpenstackCloud Architect Alliance #15: Openstack
Cloud Architect Alliance #15: Openstack
 
Deep Dive: OpenStack Summit (Red Hat Summit 2014)
Deep Dive: OpenStack Summit (Red Hat Summit 2014)Deep Dive: OpenStack Summit (Red Hat Summit 2014)
Deep Dive: OpenStack Summit (Red Hat Summit 2014)
 
All about open stack
All about open stackAll about open stack
All about open stack
 
OpenStack 101 update
OpenStack 101 updateOpenStack 101 update
OpenStack 101 update
 
Openstack 101
Openstack 101Openstack 101
Openstack 101
 
VMworld 2013: VMware NSX Integration with OpenStack
VMworld 2013: VMware NSX Integration with OpenStack VMworld 2013: VMware NSX Integration with OpenStack
VMworld 2013: VMware NSX Integration with OpenStack
 
Private Cloud with Open Stack, Docker
Private Cloud with Open Stack, DockerPrivate Cloud with Open Stack, Docker
Private Cloud with Open Stack, Docker
 
OpenStack 101
OpenStack 101OpenStack 101
OpenStack 101
 
What is OpenStack and the added value of IBM solutions
What is OpenStack and the added value of IBM solutionsWhat is OpenStack and the added value of IBM solutions
What is OpenStack and the added value of IBM solutions
 
Container orchestration k8s azure kubernetes services
Container orchestration  k8s azure kubernetes servicesContainer orchestration  k8s azure kubernetes services
Container orchestration k8s azure kubernetes services
 
Gordonh0945deepdive openstackcompute-140417174059-phpapp02
Gordonh0945deepdive openstackcompute-140417174059-phpapp02Gordonh0945deepdive openstackcompute-140417174059-phpapp02
Gordonh0945deepdive openstackcompute-140417174059-phpapp02
 
Deep Dive Into the CERN Cloud Infrastructure - November, 2013
Deep Dive Into the CERN Cloud Infrastructure - November, 2013Deep Dive Into the CERN Cloud Infrastructure - November, 2013
Deep Dive Into the CERN Cloud Infrastructure - November, 2013
 
VMUG22 Filip Verloy VIO
VMUG22 Filip Verloy VIOVMUG22 Filip Verloy VIO
VMUG22 Filip Verloy VIO
 
Oct meetup open stack 101 clean
Oct meetup open stack 101   cleanOct meetup open stack 101   clean
Oct meetup open stack 101 clean
 

More from Nagios

More from Nagios (16)

Mike Weber - Nagios and Group Deployment of Service Checks
Mike Weber - Nagios and Group Deployment of Service ChecksMike Weber - Nagios and Group Deployment of Service Checks
Mike Weber - Nagios and Group Deployment of Service Checks
 
Mike Guthrie - Revamping Your 10 Year Old Nagios Installation
Mike Guthrie - Revamping Your 10 Year Old Nagios InstallationMike Guthrie - Revamping Your 10 Year Old Nagios Installation
Mike Guthrie - Revamping Your 10 Year Old Nagios Installation
 
Thomas Schmainda - Tracking Boeing Satellites With Nagios - Nagios World Conf...
Thomas Schmainda - Tracking Boeing Satellites With Nagios - Nagios World Conf...Thomas Schmainda - Tracking Boeing Satellites With Nagios - Nagios World Conf...
Thomas Schmainda - Tracking Boeing Satellites With Nagios - Nagios World Conf...
 
Nagios World Conference 2015 - Scott Wilkerson Opening
Nagios World Conference 2015 - Scott Wilkerson OpeningNagios World Conference 2015 - Scott Wilkerson Opening
Nagios World Conference 2015 - Scott Wilkerson Opening
 
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios CoreNrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
 
Nagios Log Server - Features
Nagios Log Server - FeaturesNagios Log Server - Features
Nagios Log Server - Features
 
Nagios Network Analyzer - Features
Nagios Network Analyzer - FeaturesNagios Network Analyzer - Features
Nagios Network Analyzer - Features
 
Nagios Conference 2014 - Mike Weber - Nagios Rapid Deployment Options
Nagios Conference 2014 - Mike Weber - Nagios Rapid Deployment OptionsNagios Conference 2014 - Mike Weber - Nagios Rapid Deployment Options
Nagios Conference 2014 - Mike Weber - Nagios Rapid Deployment Options
 
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios CoreNagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
 
Nagios Conference 2014 - Trevor McDonald - Monitoring The Physical World With...
Nagios Conference 2014 - Trevor McDonald - Monitoring The Physical World With...Nagios Conference 2014 - Trevor McDonald - Monitoring The Physical World With...
Nagios Conference 2014 - Trevor McDonald - Monitoring The Physical World With...
 
Nagios Conference 2014 - Shamas Demoret - An Overview of Nagios Solutions
Nagios Conference 2014 - Shamas Demoret - An Overview of Nagios SolutionsNagios Conference 2014 - Shamas Demoret - An Overview of Nagios Solutions
Nagios Conference 2014 - Shamas Demoret - An Overview of Nagios Solutions
 
Nagios Conference 2014 - Shamas Demoret - Getting Started With Nagios XI
Nagios Conference 2014 - Shamas Demoret - Getting Started With Nagios XINagios Conference 2014 - Shamas Demoret - Getting Started With Nagios XI
Nagios Conference 2014 - Shamas Demoret - Getting Started With Nagios XI
 
Nagios Conference 2014 - Abbas Haider Ali - Proactive Alerting and Intelligen...
Nagios Conference 2014 - Abbas Haider Ali - Proactive Alerting and Intelligen...Nagios Conference 2014 - Abbas Haider Ali - Proactive Alerting and Intelligen...
Nagios Conference 2014 - Abbas Haider Ali - Proactive Alerting and Intelligen...
 
Nagios Conference 2014 - Sam Lansing - Utilizing Data Visualizations in Syste...
Nagios Conference 2014 - Sam Lansing - Utilizing Data Visualizations in Syste...Nagios Conference 2014 - Sam Lansing - Utilizing Data Visualizations in Syste...
Nagios Conference 2014 - Sam Lansing - Utilizing Data Visualizations in Syste...
 
Nagios Conference 2014 - Sam Lansing - Advanced Features of Nagios XI
Nagios Conference 2014 - Sam Lansing - Advanced Features of Nagios XINagios Conference 2014 - Sam Lansing - Advanced Features of Nagios XI
Nagios Conference 2014 - Sam Lansing - Advanced Features of Nagios XI
 
Nagios Conference 2014 - Paloma Galan - Monitoring Financial Protocols With N...
Nagios Conference 2014 - Paloma Galan - Monitoring Financial Protocols With N...Nagios Conference 2014 - Paloma Galan - Monitoring Financial Protocols With N...
Nagios Conference 2014 - Paloma Galan - Monitoring Financial Protocols With N...
 

Recently uploaded

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

Nagios Conference 2014 - Konstantin Benz - Monitoring Openstack The Relationship Between Nagios and Ceilometer

  • 1. Monitoring Openstack – The Relationship Between Nagios and Ceilometer Konstantin Benz, Researcher @ Zurich University of Applied Sciences benn@zhaw.ch
  • 2. Introduction & Agenda •About me •Working as researcher @ Zurich University of Applied Sciences •OpenStack / Cloud Computing •Engaged in monitoring and High Availability systems •Currently working on a Europe-wide cloud federation: •XIFI – eXtensible Infrastructure for Future Internet http://www.fi-xifi.eu •17 nodes / OpenStack clouds •Test environment for Future Internet (FI-WARE) applications •Infrastructure for smart cities, public healthcare, traffic management… •European-wide L2-connected backbone network •Nagios as main monitoring tool of that project
  • 3. Introduction & Agenda •What are you talking about in this presentation? • How to use Nagios to monitor an OpenStack cloud environment • Integrate Nagios with OpenStack •Anything else? • Cloud monitoring requirements • OpenStack cloud management software and Ceilometer • Comparison between Nagios and Ceilometer: • Technological paradigms • Commonalities and differences • How to integrate Nagios with Ceilometer •Can't wait!
  • 4. Cloud Monitoring Requirements Cloud ≈ virtualization + elasticity •Types of clouds: • IaaS: virtual VMs and network devices, elasticity in number/size of devices • PaaS: virtual, elastically sized platform • SaaS: software provided by employing virtual, elastic resources •Cloud is a collection of virtual resources provided in physical infrastructure •Cloud provides resources elastically
  • 5. Cloud Monitoring Requirements Why should someone use clouds? •Cloud consumer can outsource IT infrastructure • No fixed costs for cloud consumer • Pay for resource utilization • Cloud provider responsible for building and maintaining physical infrastructure •Cloud provider can rent out unused IT infrastructure • Eliminate waste • Get money back for overcapacity
  • 6. Monitoring OpenStack OpenStack Architecture •Open source cloud computing software •Consists in multiple services: • Keystone: OpenStack identity services (authentication, authorization, accounting) • Cinder: management of block storage volumes • Nova: management and provision of virtual resources (VM instances) • Glance: management of VM images • Swift: management of object storage • Neutron: management of network resources (IPs, routing, connectivity) • Horizon: GUI dashboard for end users • Heat: orchestration of virtualized environments (important for providing elasticity) • Ceilometer: monitoring of virtual resources
  • 7. Monitoring OpenStack Things to monitor •Operation of OpenStack itself: • Services: Cinder, Glance, Nova, Swift ... • Infrastructure: Hardware, Operating System where OpenStack services are running •Operation of virtual resources provided by OpenStack: • Resource availability: VMs, virtual network devices • Resource utilization: VM uptime, CPU / memory usage → Virtual resources are commonly monitored by Ceilometer → Ceilometer gathers data through the API of OpenStack services
  • 8. Monitoring OpenStack Why is Ceilometer not enough? → Ceilometer monitors virtual resources through APIs of OpenStack components, BUT NOT operation of the OpenStack components
  • 9. Comparison Nagios / Ceilometer Nagios operational model •Configuration: • Check interval (and retry interval) to poll system status and update frontend GUI • Remote execution of monitoring clients (usually Nagios plugins) • Thresholds that result in "Okay", "Warning", "Critical" status messages which are sent back to Nagios server (and "Unknown" if status not measurable) Main usage: • Effective monitoring solution for physical servers • System administration console that allows for fast reaction in case of problems • Strength: extensibility and customizability • Nagios must be extended in order to monitor virtual resources inside administrated systems
  • 10. Comparison Nagios / Ceilometer Ceilometer operational model •Configuration: • Polling services check metrics • OpenStack objects generate event notifications automatically • All events and metrics collected in a database Main usage: • OpenStack integrated metrics collector and database • Temporal database that can be used for rating, charging and billing of virtual resource utilization • Strength: fully integrated in OpenStack, collecting most important metrics and storing their change history • Weakness: Does not monitor physical hosts
  • 11. Nagios / OpenStack Integration Alternative 1: Ceilometer Plugin in Nagios •Use Nagios server as frontend for Ceilometer: • Nagios plugin that queries Ceilometer database • Virtual resource utilization data collected by Ceilometer • Nagios server responsible for monitoring non-virtual resources Benefits: • Simple and easy to implement • No extra Nagios plugins required to monitor virtual devices that are managed within OpenStack • Ceilometer tool can be left unchanged Drawbacks: • Monitoring data is stored at 2 different places: Nagios flat file and Ceilometer database
  • 12. Nagios / OpenStack Integration Alternative 1: Ceilometer Plugin in Nagios •Implementation: • Nagios plugin on client which hosts the Ceilometer API (code sample below) • Initialization with default values, OpenStack authentication: #!/bin/bash #initialization with default values SERVICE='cpu_util' THRESHOLD='50.0' CRITICAL_THRESHOLD='80.0' #get openstack token to access ceilometer-api export OS_USERNAME="youruser" export OS_TENANT_NAME="yourtenant" export OS_PASSWORD="yourpassword" export OS_AUTH_URL=http://yourkeystoneurl:35357/v2.0/
  • 13. Nagios / OpenStack Integration Alternative 1: Ceilometer Plugin in Nagios •The plugin should receive paramaters for: • Resource to be monitored (VM) • Service (Ceilometer metric) • Warning threshold • Critical threshold while getopts ":hs:t:T:" opt do case $opt in h ) printusage;; r ) RESOURCE=${OPTARG};; s ) SERVICE=${OPTARG};; t ) THRESHOLD=${OPTARG};; T ) CRITICAL_THRESHOLD=${OPTARG};; ? ) printusage;; esac done
  • 14. Nagios / OpenStack Integration Alternative 1: Ceilometer Plugin in Nagios •Query Nova API to get resource to monitor (VM to be monitored): RESOURCE=$(nova list | grep $RESOURCE | tail -2 | head -1 | awk -F '|' '{print $2; end}') RESOURCE=$(echo $RESOURCE) •Query metric on that resource, multiple entries possible requires an iterator): ITERATOR=$(ceilometer meter-list -q "resource_id=$RESOURCE" | grep -w $SERVICE | awk 'END{print NR; end}') •Initialize with return code 0 (no warning or error): RETURNCODE=0
  • 15. Nagios / OpenStack Integration Alternative 1: Ceilometer Plugin in Nagios •Iterate through metric: for (( C=1; C<=$ITERATOR; C++ )) do METER_NAME=$(ceilometer meter-list -q "resource_id=$RESOURCE" | grep -w $SERVICE | awk -F '|' -v var="$C" '{if (NR == var) {print $2 $1; end}}') METER_UNIT=$(ceilometer meter-list -q "resource_id=$RESOURCE" | grep -w $SERVICE | awk -F '|' -v var="$C" '{if (NR == var) {print $4 $1; end}}') RESOURCE_ID=$(ceilometer meter-list -q "resource_id=$RESOURCE" | grep -w $SERVICE | awk -F '|' -v var="$C" '{if (NR == var) {print $5 $1; end}}') ACTUAL_VALUE=$(ceilometer sample-list -m $METER_NAME -q "resource_id=$RESOURCE" -l 1 | grep $RESOURCE_ID | head -4 | tail -1| awk -F '|' '{print $5; end}')
  • 16. Nagios / OpenStack Integration Alternative 1: Ceilometer Plugin in Nagios •Update return code if value of one metric is above a threshold: if [ $(echo "$ACTUAL_VALUE > $THRESHOLD" | bc) -eq 1 ] then if (( "$RETURNCODE" < "1" )) then RETURNCODE=1 fi if [ $(echo "$ACTUAL_VALUE > $CRITICAL_THRESHOLD" | bc) -eq 1 ] then if (( "$RETURNCODE" < "2" )) then RETURNCODE=2
  • 17. Nagios / OpenStack Integration Alternative 1: Ceilometer Plugin in Nagios •Output return code: STATUS=$(echo "$METER_NAME on $RESOURCE_ID is: $ACTUAL_VALUE $METER_UNIT") echo $STATUS done echo $RETURNCODE
  • 18. Nagios / OpenStack Integration Alternative 1: Ceilometer Plugin in Nagios •Plugin can be downloaded from Github: • https://github.com/kobe6661/nagios_ceilometer_plugin.git •Additionally: • NRPE-Plugin: remote execution of Nagios calls to Ceilometer • Install NRPE on Nagios Core server and server that hosts Ceilometer API • Change nrpe.cfg to include call to VM metric
  • 19. Nagios / OpenStack Integration Alternative 1: Implementation •OpenStack installed on 3 nodes: • Management node: responsible for monitoring other OpenStack nodes • Controller node: responsible for management and configuration of cloud resources (VMs, network) • Compute node: provisions virtual resources
  • 20. Nagios / OpenStack Integration Alternative 2: Nagios OpenStack Plugins •Nagios as a tool to monitor OpenStack services and VMs: • Plugins to monitor health of OpenStack services • As soon as new VMs are created, Nagios should monitor them • Requires elastic reconfiguration of Nagios Benefits: • No data duplication, Nagios is the only monitoring tool required to monitor OpenStack Drawbacks: • Elastic reconfiguration • Rather complex Nagios configuration
  • 21. Nagios / OpenStack Integration Alternative 2: Nagios OpenStack Plugins •Problem: • Dynamic provisioning of resources (Virtual Machines) • Dynamic configuration of hosts in Nagios Server required PROVIDES OpenStack Compute Node Virtual Machine OpenStack Controller Node MONITORS Nagios Server VM Image
  • 22. Nagios / OpenStack Integration Alternative 2: Nagios OpenStack Plugins •Problem: • What happens if VM is terminated by end user? • Nagios assumes a host failure and produces a critical warning PROVIDES OpenStack Compute Node Virtual Machine OpenStack Controller Node MONITORS Nagios Server VM Image
  • 23. Nagios / OpenStack Integration Alternative 2: Nagios OpenStack Plugins •Solution: • Nova-API triggers reconfiguration of Nagios if VMs are created or terminated PROVIDES OpenStack Compute Node Virtual Machine OpenStack Controller Node Nagios Server VM Image RECONFIGURES
  • 24. Nagios / OpenStack Integration Alternative 2: Nagios OpenStack Plugins •Another problem: • VMs must have Nagios plugins installed when they are created •Solution: • Use only VM Images that contain Nagios plugins for VM creation OR • Use package management tools like Puppet, Chef… PROVIDES OpenStack Compute Node Virtual Machine OpenStack Controller Node Nagios Server NRPE Plugins VM Image NRPE Plugins
  • 25. Nagios / OpenStack Integration Alternative 2: Nagios OpenStack Plugins •Trigger for dynamic Nagios configuration: • Find available resources via nova-api (requires name of host and IP address) #!/bin/bash NUMLINES=$(nova list | wc -l) NUMLINES=$[$NUMLINES-3] for (( C=1; C<=$ITERATOR; C++ )) do VM_NAME=$(nova list | tail -$NUMLINES | awk -F'|' -v var="$I" '{if (NR==var){print $3 $1;end}}') IP_ADDRESS=$(nova list | tail -$NUMLINES | awk -F'|' -v var="$I" '{if (NR==var){print $7 $1;end}}' | sed 's/[a-zA-Z0-9]*[=|-]//g')
  • 26. Nagios / OpenStack Integration Alternative 2: Nagios OpenStack Plugins •Trigger for dynamic Nagios configuration: • Create a config file including VM name and IP address from a template (e. g. vm_template.cfg) CONFIG_FILE=$(echo $VM_NAME).cfg sed "s/<vm_name>/$VM_NAME/g" vm_template.cfg>named_template.cfg sed "s/<ip_address>/$IP_ADDRESS/g" named_template.cfg>$CONFIG_FILE • Set Nagios as owner of the file and move file to Nagios configuration directory chown nagios.nagios $CONFIG_FILE chmod 644 $CONFIG_FILE mv $CONFIG_FILE /usr/local/nagios/etc/objects/$CONFIG_FILE
  • 27. Nagios / OpenStack Integration Alternative 2: Nagios OpenStack Plugins •Trigger for dynamic Nagios configuration: • Add config file to nagios.cfg echo "cfg_file=/usr/local/nagios/etc/objects/$CONFIG_FILE" >> /usr/local/nagios/etc/nagios.cfg • Restart nagios service nagios restart
  • 28. Nagios / OpenStack Integration Alternative 2: Nagios OpenStack Plugins •Why restart Nagios? • Nagios must know that a new VM is present or that an old VM has been terminated • Reconfigure and restart Nagios (!)
  • 29. Nagios / OpenStack Integration Alternative 2: Nagios OpenStack Plugins •Trigger for dynamic Nagios configuration: • Add trigger to Nova-API: • Nagios Event Broker module: • Check_MK: http://mathias-kettner.de/checkmk_livestatus.html • Reconfigure Nagios dynamically: • Edit nagios.cfg and restart Nagios – bad idea (!!) in a cloud environment • Autoconfiguration tools: • NagioSQL: http://www.nagiosql.org/documentation.html
  • 30. Nagios / OpenStack Integration Alternative 2: Nagios OpenStack Plugins •What other ways do exist to dynamically reconfigure Nagios? • Puppet master that triggers: • VMs to install Nagios NRPE plugins and • Nagios Server to update its configuration • Same can be done with Chef, Ansible… • Drawback: Puppet scalability if 1‘000s of servers have to be (de-)commisioned dynamically
  • 31. Nagios / OpenStack Integration Alternative 2: Nagios OpenStack Plugins •What other ways do exist to dynamically reconfigure Nagios? • Python fabric with Cuisine to trigger: • VMs to install Nagios NRPE plugins and • Nagios Server to update its configuration • Get list of VMs from novaclient.client import Client nova = Client(VERSION, USERNAME, PASSWORD, PROJECT_ID, AUTH_URL) servers = nova.servers.list() • Write VM list to file file = open('servers'‚ 'w') file.write(servers)
  • 32. Nagios / OpenStack Integration Alternative 2: Nagios OpenStack Plugins •What other ways do exist to dynamically reconfigure Nagios? • Python fabric with Cuisine to trigger: • VMs to install Nagios NRPE plugins and • Nagios Server to update its configuration • Create fabfile.py and define which servers should be configured from fabric.api import * from . import vm_recipe, nagios_recipe env.use_ssh_config = True servers=open('servers‘) serverlist=[str(line) for line in servers] env.roledefs = {‘vm': serverlist, ‘nagios_server': xx.xx.xx.xx }
  • 33. Nagios / OpenStack Integration Alternative 2: Nagios OpenStack Plugins • Assign recipes @roles(„vm") def configure_vm(): vm_recipe.ensure() @roles(„nagios") def configure_nagios(): nagios_recipe.ensure()
  • 34. Nagios / OpenStack Integration Alternative 2: Nagios OpenStack Plugins • Create vm_recipe.py and nagios_recipe.py from fabric.api import * import cuisine def ensure(): if not is_installed(): puts("Installing NRPE...") install() else: puts(„NRPE already installed") def install_prerequisites(): cuisine.package_ensure(„nrpe")
  • 35. Choice of Alternatives Which option should we choose? • Implementation advantages and drawbacks Implementation Advantages Drawbacks A1: Ceilometer collects data • Very easy solution • Scales well • Data duplication • Two monitoring systems working in parallel A2: Shell script • No data duplication • Easy solution • Difficult to maintain • Possibly insecure • Nagios is forced to restart A2: Puppet • Automatic VM and Nagios configuration • Allows for elastic reconfiguration of Nagios • Heavyweight • Bad scalability for large IaaS clusters A2: Python fabric & cuisine • Lightweight • Automatic VM and Nagios configuration • Allows for elastic reconfiguration of Nagios • Bigger configuration effort for package management with strong dependencies between packages
  • 36. Conclusion What did you talk about? •How to use Nagios to monitor an OpenStack cloud environment • Cloud monitoring requirements: • Elasticity, dynamic provisioning of virtual machines •OpenStack monitoring tools Nagios and Ceilometer • Nagios as extensible monitoring system • Ceilometer captures data through Nova-API •Nagios/OpenStack integration • Alternative 1: • Ceilometer monitors VMs with Nagios as graphical frontend • Alternative 2: • Nagios monitors VMs and is automatically reconfigured •Discovered need for dynamic reloading of Nagios configuration •Discussed advantages/drawbacks of different implementations
  • 38. The End Konstantin Benz benn@zhaw.ch