Service Puppetmaster being monitored by Nagios

1,270 views
Skip to first unread message

Wendell Araujo

unread,
Jun 18, 2012, 10:22:54 AM6/18/12
to puppet...@googlegroups.com
Good morning!

I have a server running Nagios and would like to monitor the service in my puppet server puppetmaster. Has anyone managed to do this?

grateful

Wendell

Brian Gupta

unread,
Jun 18, 2012, 8:37:04 PM6/18/12
to puppet...@googlegroups.com
So this doesn't exactly answer your question, but it is a pattern that
may be of use. So we push out a managed file to all clients that gets
updated everytime we make a commit to the puppetcode base (git post
commit hook), and have a corresponding nagios check that confirms that
the version of the file on the puppet master is the same as on the
client. This tells us if anything is broken in the loop, including a
nonfunctional puppetmaster.

>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.

Andreas Paul

unread,
Jun 19, 2012, 5:16:56 AM6/19/12
to puppet...@googlegroups.com
I'm not sure if he wants to monitor the puppet runs on the clients.
Maybe he wants to monitor if the the puppetmaster is available or not, so

/usr/lib/nagios/plugins/check_tcp -H YOURPUPPETMASTER -p 8140
TCP OK - 0.000 second response time on port 8140|time=0.000464s;;;0.000000;10.000000
or
/usr/lib/nagios/plugins/check_http -H YOURPUPPETMASTER -p 8140 -S -s "The environment must be purely alphanumeric" -e "HTTP/1.1 400 Bad Request"
HTTP OK HTTP/1.1 400 Bad Request - 0.009 second response time |time=0.009472s;;;0.000000 size=271B;;;0

would be a good start.


On Tuesday, June 19, 2012 2:37:04 AM UTC+2, Brian Gupta wrote:
On Mon, Jun 18, 2012 at 10:22 AM, Wendell Araujo
<johnnata...@gmail.com> wrote:
> Good morning!
>
> I have a server running Nagios and would like to monitor the service in my
> puppet server puppetmaster. Has anyone managed to do this?
>
> grateful
>
> Wendell

So this doesn't exactly answer your question, but it is a pattern that
may be of use. So we push out a managed file to all clients that gets
updated everytime we make a commit to the puppetcode base (git post
commit hook), and have a corresponding nagios check that confirms that
the version of the file on the puppet master is the same as on the
client. This tells us if anything is broken in the loop, including a
nonfunctional puppetmaster.

>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users+unsubscribe@googlegroups.com.

Bernd Adamowicz

unread,
Jun 19, 2012, 5:30:58 AM6/19/12
to puppet...@googlegroups.com

This might give another starting point:

 

·         http://www.bernd-adamowicz.de/180/monitoring-puppet-part-3/

·         http://www.bernd-adamowicz.de/85/synchronizing-puppet-generated-icinga-configuration/

 

Essentially the first link might be helpful.

 

Bernd

 

 

> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.

--

You received this message because you are subscribed to the Google Groups "Puppet Users" group.

To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/XwIltqb1KuQJ.


To post to this group, send email to puppet...@googlegroups.com.

To unsubscribe from this group, send email to puppet-users...@googlegroups.com.

Alexander Swen

unread,
Jun 19, 2012, 5:57:03 AM6/19/12
to puppet...@googlegroups.com
nagios_command {
    "check_puppetmaster_https":
      command_line => '$USER1$/check_http -SI $HOSTNAME$ -p 8140 -u /production/status/puppetclient --header="Accept: yaml"';
  }
 

Alexander Swen

unread,
Jun 19, 2012, 5:51:35 AM6/19/12
to puppet...@googlegroups.com
how about this:

Todd Zullinger

unread,
Jun 23, 2012, 12:18:50 PM6/23/12
to puppet...@googlegroups.com
Hi,

Wendell Araujo wrote:
> I have a server running Nagios and would like to monitor the service
> in my puppet server puppetmaster. Has anyone managed to do this?

The REST API¹ is very handy for doing this.

I use https://$server:8140/production/status/no_key for this.

I had to allow this in the auth.conf on 2.6 (which I think is a bug
that may be fixed in 2.7). Without an auth.conf, this should be
allowed by default. The auth.conf changes:

# allow all nodes to access the server status
path /status
method find
allow *

The server picks this change up automatically, no need to restart it.

This allows a check like this:

sudo curl -s -H 'Accept: pson' \
--cacert /var/lib/puppet/ssl/certs/ca.pem \
--cert /var/lib/puppet/ssl/certs/$fqdn.pem \
--key /var/lib/puppet/ssl/private_keys/$fqdn.pem \
https://$server:8140/production/status/test

I use pycurl to wrap this all up in a check that tests that the URL
returns the expected out ({"is_alive":true}) and that it does so in
reasonable time. I've attached that check. If anyone finds this
useful and has improvements, feel free to drop me a line or send me a
diff.

¹ http://docs.puppetlabs.com/guides/rest_api.html

--
Todd OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Profanity is the inevitable linguistic crutch of the inarticulate
motherfucker.
-- Bruce Sherrod

check_puppetmaster.erb
Reply all
Reply to author
Forward
0 new messages