Ad Widget

Collapse

New user Questions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • edlentz
    Member
    • Oct 2013
    • 31

    #1

    New user Questions

    I am looking to make a template to monitor certain services on Linux servers. I have found templates for Linux servers but they report on everything. How can I create my own OR can I edit an existing Template to my liking. Thanks for any help
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4806

    #2
    I am pretty sure there are user macros in that template that you can edit to edit or ignore certain services...

    Comment

    • edlentz
      Member
      • Oct 2013
      • 31

      #3
      Thanks for the reply. I am trying to get this up and running. I do not understand the templating yet. I have only a few services that I want to monitor, http, postfix, sshd, mysql. Is there simple template out there for one of these and I can clone it for the others? I have looked all day long without finding anything. I have about 350 machines that I want to monitor, so a template is the only way as far as I can see.

      Comment

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

        #4
        What versions of the tool have you installed? What flavor of agent you are using (classic or agent2)? What template have you already tried (link plz)...
        It would be much easier to help you, if you share a liiiiitle bit of info...

        Comment

        • edlentz
          Member
          • Oct 2013
          • 31

          #5
          The version of Zabbix is 6.4.7 and I have the Agent2 installed on several systems and I am getting info back. I am using the Linux by Zabbix Agent template to start, https://git.zabbix.com/projects/ZBX/...lates/os/linux

          Comment

          • edlentz
            Member
            • Oct 2013
            • 31

            #6
            So I have things kinda working. Using this template (I full cloned it) SystemD by Zabbix Agent2, I changed the macro
            Click image for larger version

Name:	image.png
Views:	212
Size:	18.9 KB
ID:	473381​
            Stopping chronyd and starting it gives me alerts. The next question is: How can I use a macro like this to watch multoiple services ie: httpd, cron, postfix, etc I tried to add them all into the value ie: cron.service,chronyd.service, etc I got an error. I tried to add a second Macro {$systemd.name.service.matches} Value cron.service And got an error that I could only have one macro like that. Suggestions??

            Thanks

            Comment

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

              #7
              value is regex... so you can add it like (chrony|httpd|cron|postfix).service

              Comment

              • edlentz
                Member
                • Oct 2013
                • 31

                #8
                I must be doing something wrong. I can get it to only monitor one service with that entry. How would I ignore certain services?

                Comment

                • edlentz
                  Member
                  • Oct 2013
                  • 31

                  #9
                  I foound the method to ignore discovered items in the macro. So I am all good until I'm not LOL
                  Thanks Cyber for your help

                  Comment

                  • edlentz
                    Member
                    • Oct 2013
                    • 31

                    #10
                    Back at it. So in the macro {$SYSTEMD.NAME.SERVICE.MATCHES} I have this for the value ^(chronyd|crond|fail2ban|httpd|mariadb|postfix|ssh |freepbx).service I see data for all but fail2ban. I can query the system from the command line with service fail2ban status and it is running. If I run systemctl --type=service --state=running fail2ban is listed as a service. I am confused, thanks

                    Comment

                    • edlentz
                      Member
                      • Oct 2013
                      • 31

                      #11
                      I just found a Fail2Ban template, I am going to play with that

                      Comment

                      • edlentz
                        Member
                        • Oct 2013
                        • 31

                        #12
                        The fail2ban template only reports that the service is not running no mtter what. The instructions say it uses ping to see if it is alive but I wee mothing in the template yaml to support that. anyway back to my original issue for today.

                        Thanks

                        Comment

                        • solution
                          Senior Member
                          • Jun 2020
                          • 269

                          #13
                          Your regex is: name.service
                          How does the fail2ban service name appear when executing "systemctl --type=service --state=running" ?
                          if the name is "fail2ban.service" then your regex is correct.
                          but if the name is for example: "fail2ban-server.service", then change your regex to fail2ban-server

                          Wellington​

                          Comment

                          • edlentz
                            Member
                            • Oct 2013
                            • 31

                            #14
                            It comes back as fail2ban.service

                            Comment

                            Working...