Config generrator/templating

David Jones <[email protected]>
Newsgroups gmane.comp.monitoring.monit.general
Message-ID <BN6PR19MB0978FA06A44169A0C9DE39F4C6E80@BN6PR19MB0978.namprd19.prod.outlook.com>
Anyone know of a config file generator or templating system for monit?  I created my own scripts to run from cron that would detect items to be monitored dynamically.

For example, if someone installs a new package like mariadb on a server, the script would detect the PID file or use "monit procmatch" to create/update /etc/monit.d/mariadb.cfg.  Or if someone creates a new /etc/swatch.d/example.conf then add/update the /etc/monit.d/swatch.cfg.

This dynamic updating capability is very useful.  Maybe this could be done with a simple verb option that would allow for something like "depends on" but doesn't cause an error.  This would simple not load sections and their dependents when a check fails.

check process mariadb_proc with path /var/run/mariadb.pid
    active when exec "/bin/rpm -q mariadb-server"

check file mariadb_my_cnf with path /etc/my.cnf
    depends on mariadb_proc

Then the first process won't load when the package isn't installed and the second file won't error because it depends on the first.  I don't want to use the unmonitor and have a hundred items in the "monitor summary" output.

Also, I scripted a generator for /etc/monit.d/filesystems.cfg that will automatically monitor all local filesystems with different thresholds based on the size of the volume.  Smaller filesystems will get the standard 90% used threshold but larger ones in the hundreds of GBs  or TBs will hae a 95% or 98% threshold

Thanks,
Dave

-- 
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.