Ad Widget

Collapse

how to fix corrupted trigger expression?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • harri
    Member
    • Nov 2010
    • 89

    #1

    how to fix corrupted trigger expression?

    Trying to adjust the max value for "Too many processes on {HOSTNAME}" the trigger got corrupted (see attachment).

    Replacing or deleting the expression and adding a new one did not work. Zabbix told me "Warning. Incorrect value for [expr_temp]".

    How can I fix this? Any helpful comment would be highly appreciated.

    Zabbix is version 1.8.3-2, as included in Debian.
    Attached Files
  • sarathyme
    Member
    • Mar 2009
    • 58

    #2
    try to paste the expression

    Code:
    {Template_Debian:proc.num[].last(0)}>300
    If that is what you have done and it is still giving error please post the steps you are doing.

    Regards
    Vijay

    Comment

    • harri
      Member
      • Nov 2010
      • 89

      #3
      Originally posted by sarathyme
      try to paste the expression

      Code:
      {Template_Debian:proc.num[].last(0)}>300
      The expression box was read-only, when I tried. If I edit the trigger for the template, then I can fix it, as you suggested.

      Here is how to reproduce the bad expression:

      Edit the triggers of Template_Linux, search for "Too many processes on {HOSTNAME}" and click on it. Now you get an edit window for the trigger. Click on the [Select] box next to the expression, set "N" in the condition window to 1000, and click on [Insert]. Now you should see a broken condition as in my snapshot. There is no error message on saving the bad trigger.

      What would be the recommended procedure to change "N" for a single host without affecting the template?

      Comment

      • alixen
        Senior Member
        • Apr 2006
        • 474

        #4
        Hi,

        Originally posted by harri
        What would be the recommended procedure to change "N" for a single host without affecting the template?
        Quik and dirty solution:
        Go in host configuration, select template in "Linked templates" list. Click "Unlink" and save.
        You can then modify your trigger since it is not readonly anymore.
        However, everything defined by the template is now specific to this host instead of beeing linked to template. Any future modification in template will not be propagated to this host.

        Better solution:
        Disable trigger for this host.
        Create your own trigger associated to the host (not the template).
        You'll keep the link to template for everything else but you'll have to make sure that trigger coming from template is not re-enabled when you modify the template.

        Cleanest solution:
        In template, define a macro {$MAX_PROC_NUM} with value 300.
        Change trigger definition in template:
        Code:
        {Template_Debian:proc.num[].last(0)}>{$MAX_PROC_NUM}
        In your host, add the same macro {$MAX_PROC_NUM} with value 1000.
        See documentation : http://www.zabbix.com/documentation/...os#user_macros for details

        Regards,
        Alixen
        http://www.alixen.fr/zabbix.html

        Comment

        • sarathyme
          Member
          • Mar 2009
          • 58

          #5
          very good reply, thanks for the detailed info.

          Comment

          • zabbix_zen
            Senior Member
            • Jul 2009
            • 426

            #6
            The expression box was read-only, when I tried. If I edit the trigger for the template, then I can fix it, as you suggested.
            Question: Are you trying to edit the Templated Trigger expression at the Templates window level or at the linked Host level?


            What would be the recommended procedure to change "N" for a single host without affecting the template?
            You can navigate to the intended host,
            select the Templated Trigger, clone it, adjust to the new Threshold, save.
            Now you'll see two similar Triggers: the original Templated one and the clone.
            Disable the original one

            Comment

            • harri
              Member
              • Nov 2010
              • 89

              #7
              Originally posted by zabbix_zen
              Question: Are you trying to edit the Templated Trigger expression at the Templates window level or at the linked Host level?
              I am not quite sure about your terminology, but AFAICT I tried both. If I click on Configuration --> Templates --> Triggers(Template_Linux) --> Too many processes on {HOSTNAME}, then I can edit the expression box.

              If I use Configuration --> Hosts --> Triggers(myhost) --> Too many processes on {HOSTNAME}, then the expression box is read-only.

              For both I can click on Select, change the value for N, and click on Insert, giving me a broken trigger expression. I can save without error message in both cases, but for the "Hosts" case the new expression is ignored, including the new value for N.

              You can navigate to the intended host,
              select the Templated Trigger, clone it, adjust to the new Threshold, save.
              Now you'll see two similar Triggers: the original Templated one and the clone.
              Disable the original one
              This works, but only if I edit the threshold in the expression box.

              Can you reproduce this?

              Comment

              • zabbix_zen
                Senior Member
                • Jul 2009
                • 426

                #8
                Hi.

                On the first question I specifically wanted you to understand the differences, from your reply, you already noticed them.

                Reproduce what I explained or your error?
                What I explained is the same as alixen's "better method", you can try his 3rd method, it's the best one.
                I haven't run into your error though.

                Comment

                Working...