Changes between Initial Version and Version 1 of how-to/servers/puppet/setup-nagios-monitor


Ignore:
Timestamp:
May 2, 2013, 9:14:13 PM (6 years ago)
Author:
Ross
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • how-to/servers/puppet/setup-nagios-monitor

    v1 v1  
     1== Creating a nagios monitor ==
     2This page explains how to create a nagios monitor configuration in [wiki:how-to/puppet puppet].  You will need to make changes to get the correct configuration for the type of monitoring. 
     3
     4=== Set up an executable ===
     5These files are stored in puppet/modules/mayfirst/files/monitor-utils/ you can
     6find examples of different versions of monitoring scripts there.
     7
     8=== Set up a cronjob ===
     9projects/puppet/modules/mayfirst/templates/monitor-utils/cron.d/mf-monitor
     10
     11You'll need to add your script to this directory.
     12
     13=== Add to utils.pp ===
     14puppet/modules/mayfirst/manifests/utils.pp
     15
     16The code should look something like this, with the correct file from the executable specified.:
     17
     18{{{
     19  file { "/usr/local/sbin/mf-monitor-mailq":
     20    source => "puppet:///modules/mayfirst/monitor-utils/mf-monitor-mailq",
     21    ensure => present,
     22    mode => 755,
     23    owner => "root",
     24    group => "root"
     25  }
     26}}}
     27
     28=== Define hostgroup ===
     29projects/puppet/modules/mayfirst/files/nagios/nagios3/conf.d/
     30
     31This code section should look something like this:
     32
     33{{{
     34define hostgroup {
     35  hostgroup_name  mailq-servers
     36  alias           Mail Check Servers
     37}
     38}}}
     39
     40=== Define nagios command ===
     41puppet/modules/mayfirst/files/nagios/nagios3/commands.cfg
     42
     43Should look like this:
     44
     45{{{
     46define command{
     47  command_name    check-upgrade
     48  command_line    /usr/local/share/nagios/plugins/mf-nagios-check-upgrade '$HOSTNAME$'
     49}
     50}}}
     51=== Create parsing script ===
     52You will also need to create a script that parses the output of the monitoring
     53files.
     54
     55projects/puppet/modules/mayfirst/files/nagios/nagios-plugins/plugins/mf-SCRIPT-NAME
     56
     57You can model scripts that already exist to check this.
     58
     59=== Finally add the hostgroup to nagios manifest ===
     60
     61projects/puppet/modules/mayfirst/manifests/nagios.pp
     62
     63One example for standard_hostgroups is:
     64{{{
     65  if ( $include_standard_hostgroups == true ) {
     66    $standard_hostgroups = [ 'df-servers', 'upgrade-servers', 'mailq-servers' ]
     67    $assigned_hostgroups = concat($hostgroups, $standard_hostgroups)
     68  } else {
     69    $assigned_hostgroups = $hostgroups
     70   
     71  }
     72}}}
     73
     74This is from 'define m_nagios_host'.
     75
     76'''Make sure all executable scripts have execute permissions'''