If you’ve attended the OSMC 2013 and the Icinga presentation you might have seen it already, but for all new readers – Icinga 2 got native support for writing metrics to graphite carbon-cache. There’s not much to do than
- have Icinga 2 installed & some checks configured
- have graphite up & running
- enable the GraphiteWriter feature
I’m using a Vagrant box for graphite where I am running a puppet module to install graphite from sources, but patching it for realtime performance – so you might assign that a little more disk space then.
The Icinga 2 Vagrant box will install the latest and greatest snapshot rpms built from git next, so we are bleeding edge here – if you encounter any bugs, please report them to https://dev.icinga.org
The graphite vagrant box will listen on the forwarded port 20003 on localhost’s ip address. Feel free to modify the virtualbox portforwarding though – it’s just a different port not to harm any local installs.
Now get into the Icinga 2 Vagrant box and enable the GraphiteWriter feature.
$ vagrant ssh $ sudo -i # icinga2 feature enable graphite
Now uncomment host and port, and modify it to your carbon cache listener. Restart Icinga 2 to apply changes.
# vim /etc/icinga2/features-available/graphite.conf /** * The GraphiteWriter type writes check result metrics and * performance data to a graphite tcp socket. */ library "perfdata" object GraphiteWriter "graphite" { host = "192.168.2.101", port = 20003 } # service icinga2 restart
The Vagrant graphite box is accessible at http://localhost:8081.
Home exercise: Set “check_interval = 1s” in your services, and watch graphite in realtime (patched auto-refresh). If you need some detailed insights on graphite itself, you may checkout my employer’s trainings.
You’re guide has deprecated functions it isn’t “incinga2-enable-feature” anymore,
“icinga2 feature enable graphite”
is now the correct command
Right, that changed in 2.2 when the cli commands where introduced. Thanks.
I tried to follow the same steps and after restating the service its throwing
[2016-08-05 06:12:55 -0400] information/ConfigItem: Triggering Start signal for config items
[2016-08-05 06:12:55 -0400] information/ApiListener: Adding new listener on port ‘5665’
[2016-08-05 06:12:55 -0400] critical/TcpSocket: Invalid socket: Connection refused
[2016-08-05 06:12:55 -0400] critical/GraphiteWriter: Can’t connect to Graphite on host ‘127.0.0.1’ port ‘20003’.
[2016-08-05 06:12:55 -0400] information/ConfigItem: Activated all objects.
Can you help us resolving the same
Thanks!
That blog post isn’t uptodate, there is no Graphite Vagrant box anymore. Instead it is fully integrated into the “icinga2x” box, read more about it here: https://www.icinga.org/2015/12/02/vagrant-box-playtime/
Could you please explain the work flow of icinga and graphite(Relation between icinga2 and graphite)