hermanekt / zabbix_systemd

This is template for native monitoring systemd services via Zabbix Agent 2. Zabbix agent 2 is a new generation of Zabbix agent and may be used in place of Zabbix agent. Template is for Zabbix 4.4+
5 stars 3 forks source link

Detect services that have not a true conditional start #1

Closed stephdl closed 3 years ago

stephdl commented 3 years ago

Some services with systemd does not satisfy to a true condition to be started, I mean a configuration file, an empty folder for example.

This is an example

[root@prometheus ~]# systemctl status nethserver-system-init.service
● nethserver-system-init.service - Initialize NethServer configuration
   Loaded: loaded (/usr/lib/systemd/system/nethserver-system-init.service; enabled; vendor preset: enabled)
   Active: inactive (dead)
Condition: start condition failed at Wed 2021-03-17 09:56:14 CET; 7h ago
     Docs: https://github.com/nethesis/nethserver-base
[root@prometheus ~]# systemctl cat  nethserver-system-init.service
[root@prometheus ~]# systemctl cat  nethserver-system-init.service
# /usr/lib/systemd/system/nethserver-system-init.service
[Unit]
Description=Initialize NethServer configuration
Documentation=https://github.com/nethesis/nethserver-base
ConditionPathExists=/var/spool/first-boot
After=network-online.target
DefaultDependencies=false
Conflicts=shutdown.target
RefuseManualStart=true
RefuseManualStop=true

[Service]
Type=oneshot
ExecStart=/sbin/e-smith/signal-event system-init

[Install]
WantedBy=multi-user.target

I would like to exclude these systemd service, does agent2 can do it ?