Ad Widget

Collapse

Systemd template: How to ignore "Service is not running"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • executor
    Junior Member
    • Sep 2021
    • 5

    #1

    Systemd template: How to ignore "Service is not running"

    I am running Zabbix server and agent 2 5.0.15 on a Debian host and recently linked the new "Systemd by Zabbix agent 2" template to it. Now I am getting alerts like this for systemd oneshot services: "nvi.service: Service is not running". I tried to set the macro
    Code:
     {$SYSTEMD.NAME.SERVICE.NOT_MATCHES}
    to
    Code:
    rsync\.service|systemd\-fsck\-root\.service|nvi\.service|pppd\-dns\.service|anacron\.service|netdiag\.service
    but it has not made a difference. Any suggestions what I am doing wrong or what I could try?
  • executor
    Junior Member
    • Sep 2021
    • 5

    #2
    Finally figured it out after rereading several posts and the ultimate hint was here: https://www.zabbix.com/forum/zabbix-...049#post429049

    Not only do you have to set the regex in the macro but afterwards, you also have to delete the already discovered items, otherwise it will keep warning about them forever.

    Comment

    • amanogue
      Member
      • Mar 2015
      • 34

      #3
      Hi all


      I'm having the same issue as you. how were you able to solve it?


      This is the content of my macro
      Code:
      {$SYSTEMD.NAME.SERVICE.NOT_MATCHES}
      =
      Code:
      ^(sssd\.service|smartd\.service|selinux-autorelabel-mark\.service|microcode\.service|nvmefc-boot-connections\.service| ostree-remount\.service|multipathd\.service)$
      . I've detached/atached the macro serveral times but warnings still apears.

      BR​

      Comment

      • executor
        Junior Member
        • Sep 2021
        • 5

        #4
        As I wrote, you need to explicitly delete the items that were already discovered.

        Comment

        • cyber
          Senior Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • Dec 2006
          • 4807

          #5
          Just to save some space you can enter that regex as
          Code:
          ^(service1|service2|service3|...|serviceN)\.service$
          no need to enter that "service" everywhere...

          Comment

          Working...