Hello,
I would like to introduce to you the hobbit-agent. Hobbit-agent is a modified hobbit-client and a replacement for it.
The goal: allow more central control of the configs of big number of client instances from hobbit-server without logins to clients.
Hobbit-agent is a script invoked from hobbitclient.sh and does the following:
get and read the configfile hobbit-agent.cfg from $BBDISP
get all configfiles defined in variable HOBBITAGENT_CONFIG_FILES for example: HOBBITAGENT_CONFIG_FILES="bb-hosts bb-services bb-sensorstab"
fetch and execute cfg-generators defined in variable $HOBBITAGENT_CFG_GENERATORS. Cfg-generators are located on hobbit-server in directory $BBHOME/cfg-generators/. Cfg-generators are code-snippets, that generates variables depending on the local system. For example: HOBBITAGENT_CFG_GENERATORS="configclass bblocation hardwareclass bbostype"
configclass: set the variable CONFIGCLASS from bb-hosts-tag "CLASS:" for this client. that allows to modify the CLASS of the client from central bb-hosts file.
bblocation: set the variable BBLOCATION from bb-hosts-tag "BBNET:" for this client. That allows to activate the handling as network test tool for all hosts with corresponding bb-hosts-tag "NET:" and distribution of network-tests from central bb-hosts-file to different clients without login to clients.
hardwareclass: set the variable HWCLASS (similar to CONFIGCLASS) from bb-hosts-tag "HWCLASS:" for this client. This variable is used from my ext-script healt.sh that evaluate the bb-sebsorstab for temperature and fan tresholds. The file bb-sensorstab is also for him.
bbostype: my first cfg-genetaror. Simply set the variable BBOSTYPE from "uname -s". Cosmetic pieces.
Cfg-generators written the files with variables to direcrory $HOBBITCLIENTHOME/etc/hobbitclient.d/.
generate includefiles for hobbitclient.cfg and write it to /var/run/hobbit/hobbitclient-include.cfg
All variables from hobbit-client.cfg and generated variables are available for hobbitclient.sh, hobbitclient-linux.sh and all plugins.
Hobbit-agent can be expanded easily by adding own variables and cfg-generators.
I have also modified the hobbitclient.sh for more automatic hobbit-plugins updates (clientupdate):
- pre-update: if variable $CLEANUP_BEFORE_CLIENTUPDATE = "yes" all old plugins are deleted. It allows to remove plugins, that are no longer needed, from clients.
- post-update: generate new include-file /var/run/hobbit/clientlaunch-include.cfg for all plugins. It activates the new plugins without restarting hobbit.
Hobbit-agent contains binaries bbtest-net, hobbitping and scripts bbtest-net.sh and bbretest-net.sh. If the variable BBLOCATION is set to a non-null value, bbtest-net does all network testst for all hosts with corresponding "NET:" tag.
Hobbit-agent contains a new client directory-tree ext-helper. Similar to ext-directory. This directory contains subdirectories every1min, every5min, every30min, every1hour for jobs that are not possible with hobbit-user permissions.
For example: make conntrack table available for hobbit-user: ${CAT} /proc/net/ip_conntrack > ${BBTMP}/ip_conntrack.
The scripts are called from cronjob /etc/cron.d/hobbit-ext-helper by run-parts with root permissions.
I have tested the hobbit-agent on several hundreds hosts over many months and it works well.
More info, downloads and debian-packages "hobbit-agent" for debian and ubuntu on http://www.bakarasse.de/pages/en/xymon-monitoring/hobbit-agent.php
The Hobbit-agent hopes that he could be useful for you, too.
Best Regards,
Alexander Bech
participants (1)
-
alex@bakarasse.de