I'm trying to set up monitoring of a systemd-managed process on another machine so I found this stackoverflow answer. I'm puzzled because the first answer is accepted although it is (so far as I can tell) incomplete and in fact useless, if you don't already know exactly what you are doing with Zabbix (and therefore don't need help from SO).
The lacuna of the solution is that it doesn't specify the type of the item. At least, that's how it seems to me, so please tell me where my reasoning is wrong.
First of all, as per the solution, I modified /etc/zabbix/zabbix_agentd.conf on the machine I wished to monitor, to include the line:
and then restarted the Zabbix agent process on that machine with
.
Then on the Zabbix UI I:
This is when I get stuck. The SO answer tells you to create an item with key systemd.unit.is-active[postfix] (the SO example uses ssh but I want to monitor Postfix) but the UI has a Select option which offers a list of item keys which does not include systemd.unit.is-active[*]. I can just ignore the list and type systemd.unit.is-active[postfix] anyway but then the Execute Now button is grayed/disabled. So it looks like the SO answer is telling you to create an item key which cannot be referenced. What is the missing part of the SO answer, or where is my understanding at fault?
The lacuna of the solution is that it doesn't specify the type of the item. At least, that's how it seems to me, so please tell me where my reasoning is wrong.
First of all, as per the solution, I modified /etc/zabbix/zabbix_agentd.conf on the machine I wished to monitor, to include the line:
Code:
UserParameter=systemd.unit.is-active[*],systemctl is-active --quiet '$1' && echo 1 || echo 0
Code:
systemctl restart zabbix-agent
Then on the Zabbix UI I:
- Selected a suitable host.
- Added an interface for the machine I wanted to monitor.
- Added an Item of type Zabbix Agent with Host interface as per the previous step.
This is when I get stuck. The SO answer tells you to create an item with key systemd.unit.is-active[postfix] (the SO example uses ssh but I want to monitor Postfix) but the UI has a Select option which offers a list of item keys which does not include systemd.unit.is-active[*]. I can just ignore the list and type systemd.unit.is-active[postfix] anyway but then the Execute Now button is grayed/disabled. So it looks like the SO answer is telling you to create an item key which cannot be referenced. What is the missing part of the SO answer, or where is my understanding at fault?
Comment