Skip to content

Excello-cz/netdata-plugins

Repository files navigation

Netdata plugins

You just have reached a small collection of netdata external plugins for daemontools data monitoring gathering, qmail, qmail-scanner and parser (proprietary tool for processing of logs of qmail and qmail-scanner) together with several defined allarms for specific metrics collected.

parser.plugin

parser.plugin is a netdata external plugin for monitoring output of parser cronjob. parser is used for processing of scannerd and qmail-send logs and loading processed logs into database. It detects parser presence by locating all directories with scannerd substring in its name inside /var/log directory and prepares a data collector for each one of them. The plugin is deactivated if there is no such directory.

It collects:

  1. Failed connection to DB marked as conn_failed
  2. Successfull and failed updates of scanner and delivery tables marked as scanner_success, scanner_failed, delivery_success and delivery_failed.
  3. Successfull and failed updates of unknown tables marked as unknown_success and unknown_failed
  4. Unknown log lines marked as other

This plugin is currently Linux specific.

svstat.plugin

svstat.plugin is a netdata external plugin. It detects presence of a daemontools by changing working directory to /service. The plugin collects uptime and downtime in seconds since last change of the service and up/down state. The information is gathered from supervise/status file in similar manner as svstat does, however, the file is accessible only for root by default (This is feature of supervise program), therefore svstat.plugin has to have suid flag set or CAP_DAC_READ_SEARCH capability on linux.

The plugin skips all subdirectories starting with . character.

qmail.plugin

qmail.plugin is a netdata external plugin. It detects qmail presence by checking /var/log/qmail directory existence and there it locates all subdirectories containing smtp or send in theirs name and prepares data collector for each one of them.

It skips all directories starting with . character.

For smtp it collects:

  1. connection with status ok or deny,
  2. average number of connections,
  3. end statuses for 0, 256, 25600 or other value,
  4. connection via SMTP protocol type SMTP or ESMTPS,
  5. usage of TLS protocol version TLS1, TLS_1, TLS_1.1, TLS_1.2, TLS_1.3 or unknown.

For send it collects:

  1. number of start delivery and end msg,
  2. number of delivery success, failure or deferral.

For queue it collects:

  1. number of files in mess directory and its subdirectories
  2. number of files in todo directory and its subdirectories

The plugin expects mess and todo to be located in /var/qmail/queue.

This plugin is currently Linux specific.

scanner.plugin

scanner.plugin is a netdata external plugin for monitoring of scannerd, which is proprietary software with a log output similar to qmail-scanner. It detects scannerd presence by locating all directories with scannerd substring in its name inside /var/log directory and prepares a data collector for each one of them. The plugin is deactivated if there is no such directory.

It skips all directories starting with . character.

It collects:

  1. Emails with status Clear, CLAMDSCAN, SPAM-TAGGED, SPAM-REJECTED and SPAM-DELETED
  2. Spam Cache hits
  3. Antivirus Cache hits
  4. Duration of scan

The qmail-scanner does not measure Spam Cache hits and Antivirus Cache hist, but the collector should work for it either. However, it was not tested.

This plugin is currently Linux specific.

Configuration

All plugins are configured via netdata.conf. For example, user may wish to change granularity of data gathering by svstat.plugin to 10 seconds:

[plugin:svstat]
	update every = 10
	# command options =

All plugins accept value from update every parameter as a first argument (1 second by default). The second optional argument, from command options parameter, is a path to a directory, which plugin tries to set as a working directory at the beginning of its execution. For example, user may wish to set default path of a daemontools service directory to /run/service (rather than default /service) for svstat.plugin:

[plugin:svstat]
	update every = 10
	command options = /run/service

Plugin restart

It is possible to restart service by sending signal QUIT, TERM or INT (with command pkill qmail.plugin for example) and qmail.plugin quits successfully It will be started by netdata again. This may be wanted if the plugin have been updated or new log directory have been introduced.