Ad Widget

Collapse

Enable trigger between specific time

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bab
    Senior Member
    • Aug 2020
    • 176

    #1

    Enable trigger between specific time

    This is my trigger :

    min(/Linux by Zabbix agent - DBA/vfs.dev.read.await[{#DEVNAME}],15m) > {$VFS.DEV.READ.AWAIT.WARN:"{#DEVNAME}"} or min(/Linux by Zabbix agent - DBA/vfs.dev.write.await[{#DEVNAME}],15m) > {$VFS.DEV.WRITE.AWAIT.WARN:"{#DEVNAME}"}


    Now I want this trigger just enable between 13:00 - 17:00 everyday . How can do it ?
  • Answer selected by bab at 26-06-2022, 05:17.
    Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1782

    You are missing a closing )

    Markku

    Comment

    • Hamardaban
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • May 2019
      • 2713

      #2
      add to the trigger expr “and time()>130000 and time()<170000”

      Comment

      • bab
        Senior Member
        • Aug 2020
        • 176

        #3
        Originally posted by Hamardaban
        add to the trigger expr “and time()>130000 and time()<170000”

        Thanks. I changed my trigger such as below :

        min(/Rac1/vfs.dev.read.await[{#DEVNAME}],15m) > {$VFS.DEV.READ.AWAIT.WARN:"{#DEVNAME}"} or min(/Rac1/vfs.dev.write.await[{#DEVNAME}],15m) > {$VFS.DEV.WRITE.AWAIT.WARN:"{#DEVNAME}"} and time()>130000 and time()<170000

        But another it shows trigger in the problem :


        sddj: Disk read/write request responses are too high (read > 20 ms for 15m or write > 20 ms for 15m) at 04:20AM

        Comment

        • Markku
          Senior Member
          Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
          • Sep 2018
          • 1782

          #4
          See https://www.zabbix.com/documentation...sion#operators("and" is evaluated before "or").

          You need to use parenthesis around your original "X or Y" statement when you combine it with something with "and" operator.

          Markku

          Comment

          • bab
            Senior Member
            • Aug 2020
            • 176

            #5
            Originally posted by Markku
            See https://www.zabbix.com/documentation...sion#operators("and" is evaluated before "or").

            You need to use parenthesis around your original "X or Y" statement when you combine it with something with "and" operator.

            Markku

            Changed it to :

            min((/Linux by Zabbix agent - DBA/vfs.dev.read.await[{#DEVNAME}],15m) > {$VFS.DEV.READ.AWAIT.WARN:"{#DEVNAME}"}) or min((/Linux by Zabbix agent - DBA/vfs.dev.write.await[{#DEVNAME}],15m) > {$VFS.DEV.WRITE.AWAIT.WARN:"{#DEVNAME}"}) and time()>130000 and time()<170000


            but does not work and invalid parameter . Would you please change it or correct ?

            Comment

            • Markku
              Senior Member
              Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
              • Sep 2018
              • 1782

              #6
              (min() > xxx or min() > yyy)

              Markku

              Comment

              • bab
                Senior Member
                • Aug 2020
                • 176

                #7
                Originally posted by Markku
                (min() > xxx or min() > yyy)

                Markku

                I changed it such as below (min(/dwrac1/vfs.dev.read.await[{#DEVNAME}],15m) > {$VFS.DEV.READ.AWAIT.WARN:"{#DEVNAME}"} or min(/dwrac1/vfs.dev.write.await[{#DEVNAME}],15m) > {$VFS.DEV.WRITE.AWAIT.WARN:"{#DEVNAME}"} and time()>130000 and time()<170000

                another does not work and show Invalid parameter "/1/expression": incorrect expression starting from "".

                Comment

                • Markku
                  Senior Member
                  Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
                  • Sep 2018
                  • 1782

                  #8
                  You are missing a closing )

                  Markku

                  Comment

                  • bab
                    Senior Member
                    • Aug 2020
                    • 176

                    #9
                    Originally posted by Markku
                    You are missing a closing )

                    Markku

                    I changed it as follow . Is that correct ?

                    (min(/Linux by Zabbix agent - DBA/vfs.dev.read.await[{#DEVNAME}],15m) > {$VFS.DEV.READ.AWAIT.WARN:"{#DEVNAME}"} or min(/Linux by Zabbix agent - DBA/vfs.dev.write.await[{#DEVNAME}],15m) > {$VFS.DEV.WRITE.AWAIT.WARN:"{#DEVNAME}"}) and time()>130000 and time()<170000
                    Last edited by bab; 25-06-2022, 12:06.

                    Comment

                    • Markku
                      Senior Member
                      Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
                      • Sep 2018
                      • 1782

                      #10
                      Looks fine, did you try it?

                      Markku

                      Comment

                      • bab
                        Senior Member
                        • Aug 2020
                        • 176

                        #11
                        Originally posted by Markku
                        Looks fine, did you try it?

                        Markku


                        So thanks. It solved.

                        Comment

                        Working...