Ad Widget

Collapse

monitoring either one or another process

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nerijus
    Junior Member
    • Jun 2008
    • 15

    #1

    monitoring either one or another process

    Hello,

    I changed "Number of running processes syslogd" from proc.num[syslogd] to "proc.num[syslogd] | proc.num[rsyslogd]" - I want to monitor either syslogd or rsyslogd process. But now I get 0. What is the proper way?

    Thanks,
    Nerijus
  • cstackpole
    Senior Member
    Zabbix Certified Specialist
    • Oct 2006
    • 225

    #2
    I didn't know this could be done. Can anyone comment? I can see where this would be very useful!

    Comment

    • nerijus
      Junior Member
      • Jun 2008
      • 15

      #3
      proc.num[syslogd]+proc.num[rsyslogd] didn't work neither. Is it possible at all? Could Key value be an expression?

      Comment

      • trikke
        Senior Member
        • Aug 2007
        • 140

        #4
        Hi nerijus,

        The concept is: with items you just "measure" the existence or value of a item, if you want to know if the value is "true/a valid number/a string.." you have to use triggers!

        To Answer your question, make 2 items: one checking for syslogd one checking rsyslogd, than create a trigger checking if either is available ( {serverroc.num[syslogd].last(0)>0} | {serverroc.num[rsyslogd].last(0)>0} )

        Hope to have helped u,

        greets
        Patrick

        Comment

        • nelsonab
          Senior Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • Sep 2006
          • 1233

          #5
          Trikke is right on this one, plus the solution he's talking about has an added benifit. If there is an error you can know what is the cause by checking the value of each item in the trigger, which you can also put in the alert message.
          RHCE, author of zbxapi
          Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
          Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

          Comment

          • cbidwell
            Senior Member
            • Aug 2006
            • 127

            #6
            How would this be phrased in the trigger? I have it as:

            {Template_Linuxroc.num[syslogd].last(0)|proc.num[rsyslogd].last(0)}<1

            And am getting:
            • Unexpected symbol "|" in trigger function.
            • Check expression part starting from ")|proc.num[rsyslogd].last(0)}<1".

            Comment

            • cbidwell
              Senior Member
              • Aug 2006
              • 127

              #7
              I wound up with this and didn't get an error, but I'm getting trigger alarms...

              Code:
              {Template_Linux:proc.num[rsyslogd].last(0)}<1 | {Template_Linux:proc.num[syslogd].last(0)}<1

              Comment

              • JBo
                Senior Member
                • Jan 2011
                • 310

                #8
                Hi,

                Originally posted by cbidwell
                I wound up with this and didn't get an error, but I'm getting trigger alarms...

                Code:
                {Template_Linux:proc.num[rsyslogd].last(0)}<1 | {Template_Linux:proc.num[syslogd].last(0)}<1
                Since either syslog or rsyslog is not running, your expression is always true.
                This one should work:
                Code:
                {Template_Linux:proc.num[rsyslogd].last(0)}<1 & {Template_Linux:proc.num[syslogd].last(0)}<1
                (replace | by &)

                Regards,
                JBo

                Comment

                • cbidwell
                  Senior Member
                  • Aug 2006
                  • 127

                  #9
                  Wow! Awesome....Understanding the logic in that seems reversed to me, but it worked great! Thanks so much for your help.

                  Comment

                  Working...