Monitoring Puppet with Zabbix

1,622 views
Skip to first unread message

hoize

unread,
Dec 10, 2015, 10:10:24 AM12/10/15
to Puppet Users
Hello!

Is there a way to monitor puppet runs with zabbix?
Here is what i want to monitor:
- a host's puppet run is more than 20 minutes ago
- a puppet run fails

I have searched through the internet, but I only found solutions which works with zabbix-sender and my colleagues do not want to install zabbix-sender, or to use report-processors which work like zabbix-sender.

I hope someone can help me or maybe someone has a solution he uses..

Thank you!

Greets

hoize

unread,
Jan 18, 2016, 2:02:11 AM1/18/16
to Puppet Users
Has nobody an idea...?

Thomas Müller

unread,
Jan 18, 2016, 5:41:21 AM1/18/16
to Puppet Users


Am Donnerstag, 10. Dezember 2015 16:10:24 UTC+1 schrieb hoize:
Hello!

Is there a way to monitor puppet runs with zabbix?
Here is what i want to monitor:
- a host's puppet run is more than 20 minutes ago

not related but interesting: why you are running puppet that often?
 
- a puppet run fails

I have searched through the internet, but I only found solutions which works with zabbix-sender and my colleagues do not want to install zabbix-sender, or to use report-processors which work like zabbix-sender.



there is no "out of the box" solution IMHO. if you have the abbility to add ZABBIX Agent UserParameters (https://www.zabbix.com/documentation/2.0/manual/config/items/userparameters) you could write a ruby script which parses the last_run_summary.yaml file (get the path: puppet agent --configprint lastrunfile), which contains all the required information.

- Thomas 

hoize

unread,
Jan 18, 2016, 6:11:22 AM1/18/16
to Puppet Users
Hello,

thank you for your reply!

We often have many changes which are automatically done, so we need to run puppet that often.

I thougt about this way yet, because we are using Zabbix-Agent UserParameters. But -honestly- I don't know how to realise this and I'm actually not able to write a ruby script.. You must know, I'm a newbie. ^^

I'll have a look at this and give a short feedback if I found a solution!

Thank you!

Antony Fomenko

unread,
Jan 18, 2016, 9:43:19 AM1/18/16
to Puppet Users
You can get values from /var/lib/puppet/state/last_run_summary.yaml
We created facts from parsing this yaml and then just getting this fact with user script.
We use this to get nodes with failures and always running nodes (nonidepotent).
cat /etc/zabbix/conf.d/zab_puppet.conf
UserParameter=puppet.fact[*],/srv/zabbix/agent/scripts/common/zab_facter.sh $1

cat /srv/zabbix/agent/scripts/common/zab_facter.sh
#!/bin/bash

sudo facter -p $1

Then create item and trigger to read fact. Also you can read this without facter involved.

Neil - Puppet List

unread,
Jan 19, 2016, 6:29:57 AM1/19/16
to PuppetList

Hello

Using puppetdb the a query against its api would be my choice if you want not to add custom bits to you puppet infrastructure, which is an entirely reasonable thing to wish to avoid.

Neil

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/770f59fd-e5c1-4063-8f49-be6c7ac12ef5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

hoize

unread,
Feb 3, 2016, 9:55:30 AM2/3/16
to Puppet Users, maillis...@iamafreeman.com
Hello,

sorry but in the past there was honestly no time to look at this problem.
Today I had some "sparetime" and built a short script, which reads from the puppet - last_run_summary.yaml-file.
This script is started by zabbix via a zabbix-user-parameter.

I'm now able to monitor if a puppetrun is more than 20 minutes ago, if any errors came up and the puppetrun-time!

If someone needs this script or help, don't hasitate to contact me!


I thank you all very much!!!
-Hoize

Thorsten Drönner

unread,
Jul 4, 2016, 8:10:17 AM7/4/16
to Puppet Users, maillis...@iamafreeman.com
I would really appriciate it to take a look at the script.

Thorsten

swain

unread,
Mar 9, 2017, 6:24:46 PM3/9/17
to Puppet Users, maillis...@iamafreeman.com
Hi,

Would it be possible to have a look at the script?

Thanks

nandha kumar

unread,
Jan 11, 2021, 10:16:56 AM1/11/21
to Puppet Users
I need zab_facter.sh script !!

Yvan Broccard

unread,
Jan 11, 2021, 10:44:45 AM1/11/21
to puppet...@googlegroups.com
Hello,

I've done a small module to monitor puppet agent from Zabbix.

There is a small python wrapper script that reads the /opt/puppetlabs/puppet/cache/state/last_run_summary.yaml and parse the yaml.


Forgive any issue, I just created the repo from some other private repo. Not guaranteed it will work out of the box, but it's a very basic module that you could improve at your needs.

Best regards

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.

nandha kumar

unread,
Jan 11, 2021, 4:50:28 PM1/11/21
to Puppet Users
Hi Hoize ,
can i have that script to monitor zabbix_run failure ?
Reply all
Reply to author
Forward
0 new messages