{"id":13558959,"url":"https://github.com/bef/qmon","last_synced_at":"2025-03-23T00:27:58.817Z","repository":{"id":15701114,"uuid":"18438961","full_name":"bef/qmon","owner":"bef","description":"Uncomplicated monitoring for small environments","archived":false,"fork":false,"pushed_at":"2018-04-04T09:44:34.000Z","size":271,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-28T03:44:36.547Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Tcl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bef.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-04T12:58:45.000Z","updated_at":"2019-07-26T21:52:01.000Z","dependencies_parsed_at":"2022-09-01T03:51:09.992Z","dependency_job_id":null,"html_url":"https://github.com/bef/qmon","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bef%2Fqmon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bef%2Fqmon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bef%2Fqmon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bef%2Fqmon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bef","download_url":"https://codeload.github.com/bef/qmon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245040219,"owners_count":20551297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T12:05:15.609Z","updated_at":"2025-03-23T00:27:58.798Z","avatar_url":"https://github.com/bef.png","language":"Tcl","funding_links":[],"categories":["Tcl","others"],"sub_categories":[],"readme":"qmon - Q Monitoring App\n=======================\n\n![alt tag](https://raw.githubusercontent.com/bef/qmon/master/logo/qmon-logo-269-flat.png)\n\nAbout\n-----\nqmon is a monitoring application suitable for a small number of hosts and services. It aims to be a quick and secure alternative to nagios with focus on security and simplicity.\n\nFeatures:\n\n* Simple INI-style configuration file\n* Powerful macro processor for similar configuration entries\n* Nagios-compatibility: Check scripts from the nagios or icinga package can be used with qmon. Multiline output is not supported though.\n* Notification via XMPP and others\n* CGI-based web frontend\n\n\nInstallation\n------------\nRequired packages:\n\n* Tcl 8.6 or 8.5 (8.6 is preferred)\n* Tcllib 1.13\n* sqlite-tcl\n* xmpppy 0.4.1 or 0.5 (optional: for notify\\_via\\_xmpp plugin)\n* nagios or icinga plugins (optional)\n\nExample package installation with Debian/Ubuntu:\n\n\t# apt-get install tcl8.6 tcllib libsqlite3-tcl tcl-tls\n\t# apt-get install nagios-plugins-standard nagios-plugins-contrib\n\n\t# apt-get install python-xmpp\n\t(or) # pip install xmpppy --pre\n\nExample package installation with Activestate Tcl 8.6:\n\n\t# ln -s /opt/ActiveTcl-8.6/bin/tclsh8.6 /usr/local/bin\n\t# teacup update --only newer ## (!! not 'teacup update'. bad idea.)\n\t# teacup install inifile\n\t# teacup install ncgi\n\t# teacup install html\n\t# teacup install term::ansi::code::ctrl\n\nCreate dedicated qmon user and group:\n\n\t# groupadd qmon\n\t# useradd -g qmon -d /var/run/qmon qmon\n\t# mkdir -p /var/run/qmon\n\t# chown qmon:qmon /var/run/qmon\n\nIn /opt clone qmon from github:\n\n\t# cd /opt\n\t# git clone https://github.com/bef/qmon.git\n\nConfigure qmon for use with Tcl 8.5, if Tcl 8.6 is not available: Edit 'qmon' to invoke tclsh8.5:\n\n\tTCLSH=tclsh8.5\n\nCreate initial configuration file `etc/qmon.ini` (or copy `etc/qmon.ini.sample`), e.g.\n\n\t[global]\n\tplugin_path=/opt/qmon/plugins /usr/lib/nagios/plugins\n\tinterval=3600\n\tinterval_warning=1800\n\tinterval_critical=600\n\tinterval_unknown=1800\n\nThen create sqlite DB:\n\n\t# mkdir db\n\t# ./qmon update\n\t# chown -R root:qmon db\n\t# chmod 2775 db\n\t# chmod 664 db/qmon.db\n\nConfigure qmon (see below), then\n\n\t# ./qmon update\n\nSecure sensitive configuration files, e.g.\n\n\t# chown root:qmon /opt/qmon/etc/*.ini\n\t# chmod 640 /opt/qmon/etc/*.ini\n\nGo live: Edit crontab:\n\n\t# crontab -u qmon -e\n\n\tPATH=/usr/local/bin:/usr/bin:/bin\n\t0-59/5 * * * * /opt/qmon/qmon check\n\nInstall web-frontend, e.g. with boa add two lines to boa.conf:\n\n\tScriptAlias /cgi-bin/qmon /opt/qmon/cgi-bin\n\tAlias /qmon /opt/qmon/htdocs\n\nOR with apache2, copy apache.conf.sample to apache.conf and add this line to a vhost configuration:\n\n\tInclude /opt/qmon/etc/apache.conf\n\n\n\nConfiguration\n-------------\n\n### qmon.ini ###\n\nSee 'etc/qmon.ini.sample' for a quick start.\n\nFormat description:\n\n* qmon.ini consists of INI-style sections (e.g. \\[test\\]) with key/value pairs (a=b).\n* \\[global\\] is reserved for global settings. Other sections are either host descriptions or check descriptions.\n* ';' starts a one-line comment.\n* type=check can be omitted.\n* All values are processed once with variable substitution and backslash substitution, specifically $cfg(...) where ... is 'section.key', e.g. $cfg(ex.hostname)\n* Substitutions can be disabled with a ! prefix, e.g. foo=!$bar. This can be useful for notify\\_cmd, which does runtime substitution, in order to avoid double substitution problems and endless backslash-escaping. Having ! as first character is still possible with \\\\!.\n* Every _host_ implicitly sets 'desc' and 'type=host'\n* Unless explicitly changed every _check_ sets 'cmd', 'desc', 'host=unknown', 'type=check', 'enabled=1' and various intervals\n\nExample:\n\n\t[global]\n\tplugin_path=/opt/qmon/plugins /usr/lib/nagios/plugins\n\tinterval=3600\n\tinterval_warning=1800\n\tinterval_critical=600\n\tinterval_unknown=1800\n\t;notify_cmd=!echo -e \"$name is now $status2 (was $status)\" | ${::qmondir}/plugins/notify_via_xmpp me@jabber.example.com\n\n\t[tohu]\n\ttype=host\n\n\t[ex]\n\ttype=host\n\thostname=example.com\n\tip_pub=...\n\tip_priv=...\n\tdesc=example.com\n\n\t[ex_ssh]\n\ttype=check\n\thost=ex\n\tdesc=SSH\n\tcmd=check_ssh -H $cfg(ex.hostname) -4\n\t; enabled=0\n\nThe ini-parser comes with a simple, yet powerful macro processor. This is useful for reusing snippets in a way functions or procedures work with programming languages. Example:\n\n\t#template X %COLOR% %ANIMAL1% %ANIMAL2%\n\tthe quick %COLOR% %ANIMAL1% jumps over the lazy %ANIMAL2%\n\t#end template\n\t#use X brown fox dog\n\nThis would result in\n\n\tthe quick brown fox jumps over the lazy dog\n\nTemplate arguments can be any word with or without special characters, e.g. %COLOR%, $color, C, but the %%-syntax avoids accidental substitutions.\n\nMulti-word arguments can be enclosed by \"\" or {}, e.g. \"-h example.com\".\n\nTemplates can be nested, however mind multi-word arguments:\n\n\t#template A %1% %2%\n\t#use B {%1%} {%2%}\n\t#end template\n\n\t#template B %1% %2%\n\targ1=%1%\n\targ2=%2%\n\t#end template\n\n\t[B]\n\t#use B {1 2 -e \"foo\"} 3 4\n\t[A]\n\t#use A {1 2 -e \"foo\"} 3 4\n\nOutput:\n\n\t[B]\n\targ1=1 2 -e \"foo\"\n\targ2=3\n\t[A]\n\targ1=1 2 -e \"foo\"\n\targ2=3\n\nThe third argument (here '4') is silently discarded.\n\n\n### qmon ###\n\nThe launch script 'qmon' may be edited to reflect your installation preferences, such as TCLSH, directories, filenames, e.g.:\n\n\tQMON=/usr/lib/qmon\n\tTCLSH=/some/obscure/tclsh8.6\n\tEXTRA_ARGS=\"-ini /etc/qmon/qmon.ini -db /var/lib/qmon/qmon.db -lib /usr/share/qmon/lib\"\n\nUsage\n-----\n\ntry 'qmon -h'\n\n\nPlugins\n=======\n\nnotify\\_via\\_xmpp\n-----------------\nThis plugin sends arbitrary messages via XMPP. This is probably most useful with the global configuration\n\n\tnotify_cmd=echo -e \"$name is now $status2 (was $status)\" | ${::qmondir}/plugins/notify_via_xmpp user1@jabber.example.com user2@jabber.example.com\n\nAccount credentials are in etc/notify\\_via\\_xmpp.ini:\n\n\t[jidparams]\n\tjid=qmon@jabber.example.com/qmon\n\tpassword=123456\n\nThe notification logic is kept simple on purpose. Every state change from a check results in the execution of notify\\_cmd. Further logic such as notification groups or notify via xmpp and email have or only during work hours ... have to be implemented separately within notify\\_cmd.\n\n\ncheck\\_netstat\n--------------\nThis plugin parses the output of 'netstat -lntu', which shows the listening TCP and UDP ports on linux hosts. A list of 'protocol,IP:port' triplets is then matched against the configuration in the order as configured, but usually 'ok', 'warning', 'critical'.\n\nString pattern may contain wildcards '?', '*' and '\\[chars\\]' for 1, \u003e=0 or specific charecters.\n\nExample: 'tcp4,127.0.0.1:80' would be matched by any of the following patterns:\n\n\ttcp4,127.0.0.1:80\n\ttcp*,*:80\n\t*,127.0.0.1:*\n\nComplete example (keys must be unique but have no meaning):\n\n\t[global]\n\torder=ok,warning,critical\n\n\t[ok]\n\thttp=tcp*,*:80\n\thttps=tcp*,*:443\n\tignore=*,192.168.250:*\n\t; localhost=*,127.0.0.1:*\n\tsamba=*:139\n\n\t[warning]\n\tlocalhost=*,127.0.0.1:*\n\tlocalhost6=*,::1:*\n\n\t[critical]\n\tcatchall=*\n\ncheck\\_mx\n---------\nCheck SMTP server for open relay misconfiguration and greylisting.\n\nExample open relay check:\n\n\tcheck_mx -addr 10.0.0.1 openrelay\n\nExample greylisting check:\n\n\tcheck_mx -addr 10.0.0.1 -to test@example.com greylisting\n\ncheck\\_http\\_q\n--------------\nAlternative check\\_http to check for HTTP return code, headers or MD5 of response body.\n\nExample - issue warning if MD5-sum of response body is unexpected:\n\n\tcheck_http_q -md5 b01cfa73a80d7b27153b49e917f18747 http://example.com/\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbef%2Fqmon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbef%2Fqmon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbef%2Fqmon/lists"}