check_xmpp is a Nagios / Icinga2 check plugin written in Golang. It is capable of checking the connection to your XMPP server, authentication and message delivery. A valid XMPP account on the target server is needed for the plugin to work.
!!! This plugin is only compatible with STARTTLS-enabled servers and plain authentication !!!
... which most servers do offer.
./check_xmpp -timeout 5s -userid user@server.tld -password mypassword
You can add a -debug
flag if things do not work.
- Download latest binary from "Releases" section on GitHub
- ... or compile yourself by installing Golang and running "build.sh"
-
Copy binary to
/usr/local/nagios-plugins/check_xmpp
-
Register check command in
/etc/icinga2/conf.d/commands.conf
:
object CheckCommand "xmpp_client" {
import "plugin-check-command"
command = ["/usr/local/nagios-plugins/check_xmpp" ]
arguments = {
"-timeout" = "$timeout$"
"-userid" = "$userid$"
"-password" = "$password$"
}
}
- Register check in
/etc/icinga2/conf.d/services.conf
object Service "xmpp_client" {
host_name = "xmpphost"
check_command = "xmpp_client"
vars.userid = "checkuser@server.tld"
vars.password = "checkuserpassword"
vars.timeout = "5s"
check_interval = 2m
retry_interval = 1m
}
- Reload Icinga2:
systemctl reload icinga2
This is no professional coding work done by a long-term Go developer. Exception and error checks are missing in various places and code structure could definitely by cleaner. If you are more experienced and you have suggestions for nicer, cleaner code, feel free to contribute to this repository. :-)