Suppose that SSH is working on a non-standard port, in Zabbix, the “Template App SSH Service” template checks it on a standard port and will therefore send out the message “SSH service is down on …”.
To specify which port to check for SSH, we will make a complete cloning of the “Template App SSH Service” template so that it does not change it and in the new cloned template we already change the key in the data element:
to (where 500 is the SSH port number):
And we’ll specify this new template instead of the standard one, then SSH will be scanned at the specified port.
Templates are configured in the “Settings” -> “Templates” -> “Templates” group.
Similarly, the port for other services changes.
From the command line, you can check it with the following commands:
zabbix_get -s127.0.0.1 -k'net.tcp.service[ssh]' zabbix_get -s127.0.0.1 -k'net.tcp.service[ssh,,500]'