A simple tool to monitor an Apache VCL infrastructure.
npm install vcl-utils
Check all nodes and report back on their status, capturing any errors:
var health = require'vcl-utils'Health;healthon'error'console.log'ERROR :: ' + err;;healthon'info'console.log'INFO :: ' + msg;;healthcheckconfig: '/etc/vcl/vcld.conf';
Or, you can check only for computers with incorrect image revisions:
var health = require'vcl-utils'Health;healthon'incorrectImage'console.log'Incorrect Image :: ' + host;;healthcheckconfig: '/etc/vcl/vcld.conf';
info- Information about each computer managed by this management node.
error- Any errors encountered in connecting to computers.
incorrectImage- All computers with a non-matching image.
All other events correspond to the
state value of a VCL node. Some of these include:
available- All computers in an available state.
failed- All computers in a failed state.
inuse- All computers currently in use.
reloading- All computers currently reloading.
reserved- All currently reserved computers.
maintenance- All computers in the maintenance state.
check() method will find all computers for a given management node, and
(if the computer is 'available'), it will login and check that the image
revisionid matches what is listed in the database. For any other state,
the computer will not be checked, but an event corresponding to that state
will be emitted.
When issuing a health check, you can set the following option:
config: The path to the vcld.conf file. (Default:
It is typically unnecessary to set additional values. If, however, it is necessary to pass additional values to the MySQL connection, these can be set here. The full list of MySQL configuration values are available at the node-mysql page.