Skip to content

Commit

Permalink
start work on distributed monitoring
Browse files Browse the repository at this point in the history
This way, the cpantesters machine can monitor itself and report back to
the master for configuration updates and information dumps.
  • Loading branch information
preaction committed Oct 19, 2016
1 parent f25027a commit e5636a5
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
28 changes: 28 additions & 0 deletions Rexfile
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,34 @@ task deploy_monitor =>
# Needed for php to work on newer OpenBSD
# /etc/php-7.0.ini pdo_mysql.so
# Load PDO mysql

### Distributed monitoring
# http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/distributed-monitoring#distributed-monitoring-automation
# Set up monitor master
run 'icinga2 node setup --master';
# Cert gets made in /etc/icinga2/pki/ca.crt to copy to client

# Set up monitor clients
# $ apt-get install icinga2
# $ icinga2 feature enable api
# $ mkdir -p /etc/icinga2/pki
# $ chown -R icinga:icinga /etc/icinga2/pki
# $ icinga2 pki new-cert --cn <client-fqdn> \
# --key /etc/icinga2/pki/<client-fqdn>.key \
# --cert /etc/icinga2/pki/<client-fqdn>.cert
# Copy the trusted master certificate as /etc/icinga2/pki/master.crt
# $ icinga2 pki save-cert --key /etc/icinga2/pki/<client-fqdn>.key \
# --cert /etc/icinga2/pki/<client-fqdn>.crt \
# --trustedcert /etc/icinga2/pki/master.crt \
# --host <master-fqdn>
# $ icinga2 node setup --ticket <ticket> \
# --endpoint <master-fqdn> \
# --zone <client-fqdn> \
# --master_host <master-fqdn> \
# --trustedcert /etc/icinga2/pki/master.crt \
# --accept-config
# $ service icinga2 restart

run 'rcctl restart apache2';
run 'rcctl restart icinga2';
};
Expand Down
27 changes: 26 additions & 1 deletion etc/monitor/icinga/cpantesters.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

/**********************************************************************
* CPAN Testers monitoring
* CPAN Testers monitoring -- master
*
* This configuration sends out check configs to the clients so they
* can operate independently if the master goes away.
*
*********************************************************************/

/***********************************
Expand All @@ -19,6 +23,27 @@ object User "doug" {
email = "[email protected]"
}

/***********************************
* Zones and Endpoints
**********************************/

object Endpoint 'monitor.preaction.me' {
host = '199.38.182.146'
}

object Endpoint 'cpantesters3.dh.bytemark.co.uk' {
host = '212.110.173.51'
}

object Zone 'master' {
endpoints = [ 'monitor.preaction.me' ]
}

object Zone 'clients' {
endpoints = [ 'cpantesters3.dh.bytemark.co.uk' ]
parent = "master"
}

/***********************************
* Hosts
**********************************/
Expand Down

0 comments on commit e5636a5

Please sign in to comment.