Bug #15493

Adjust monitoring check for Puppet runs for Puppet master 4.x

Added by intrigeri 2018-04-06 08:35:52 . Updated 2018-05-02 10:12:33 .

Status:
Resolved
Priority:
Normal
Assignee:
groente
Category:
Infrastructure
Target version:
Start date:
2018-04-06
Due date:
% Done:

100%

Feature Branch:
Type of work:
Sysadmin
Blueprint:

Starter:
Affected tool:
Deliverable for:

Description

/var/lib/puppet/yaml/node/*.yaml don’t contain any “expiration” line anymore, so this code:

    EXPIRATION=$(grep -m1 expiration ${YAMLPATH}/$node.yaml | awk '{printf("%s %s", $2, $3);}')
    typeset -i CHECKIN=$(date +"%s" -d "${EXPIRATION}")
    DIFFERENCE=$((${NOW} - ${CHECKIN}))

… will set EXPIRATION= and then date +"%s" -d "" means “today at 00:00:00” so DIFFERENCE will always be less than 24 hours => this check will always pass regardless of the status of agent runs.


Subtasks


Related issues

Blocks Tails - Feature #13284: Core work: Sysadmin (Adapt our infrastructure) Confirmed 2017-06-30

History

#1 Updated by intrigeri 2018-04-06 08:36:10

  • blocks Feature #13284: Core work: Sysadmin (Adapt our infrastructure) added

#2 Updated by intrigeri 2018-04-06 09:14:33

  • Status changed from Confirmed to In Progress
  • % Done changed from 0 to 10

Options I’ve found:

#3 Updated by intrigeri 2018-04-08 08:46:26

  • % Done changed from 10 to 20

intrigeri wrote:
> Options I’ve found:
>
> * https://www.die-welt.net/2014/02/monitoring-your-puppet-nodes-using-puppetdb/ i.e. https://github.com/evgeni/check_puppetdb_nodes
> written in Perl => 2 of our sysadmins can maintain it if needed
> pros:
> * runs on the Puppet master, queries PuppetDB => pretty close to what we do currently => presumably easy to set up
> cons:
> * uses Nagios::Plugin which is not in Stretch anymore, but presumably porting to https://metacpan.org/pod/Monitoring::Plugin should be easy

Sent a pull request.

> * no support for ignoring a list of nodes; should be easy to add though (https://github.com/brahama/check_puppetdb_nodes can be used as a source of inspiration)

Sent a pull request.

It now works fine so I’ll port our existing (currently broken) check to check_puppetdb_nodes.

#4 Updated by intrigeri 2018-04-08 09:59:17

  • Assignee changed from intrigeri to groente
  • % Done changed from 20 to 50
  • QA Check set to Ready for QA

Seems to work fine: https://icingaweb2.tails.boum.org/monitoring/host/services?host=puppet-git.lizard#!/monitoring/service/show?host=puppet-git.lizard&service=puppet-git.lizard

See 5d3858bcb95a6b9be0a293dd7acbd58d6e15f80a..17b0eee41fea1708d3ae3685886db2ab13aa154d in our manifests repo + of course the submodule updates this revision range includes.

#5 Updated by groente 2018-05-02 10:12:33

  • Status changed from In Progress to Resolved
  • % Done changed from 50 to 100
  • QA Check changed from Ready for QA to Pass

looks good!