Ad Widget

Collapse

proc.count more than one process.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • timuckun
    Junior Member
    • Oct 2008
    • 9

    #1

    proc.count more than one process.

    On some servers I have syslogd running, on others I have rsyslogd. Same goes with http vs apache2.

    What I would like to do is to have an item that goes like this

    proc.coun[apache2] + proc.count[httpd]

    This doesn't work. On the first item gets recorded, the second one is ignored.

    Better yet proc.count could take a regexp or a list so can do

    proc.count[http|apache2] and get a sum of processes named either apache2 or httpd


    Is there a way to do this?
  • alixen
    Senior Member
    • Apr 2006
    • 474

    #2
    Hi,

    Originally posted by timuckun
    On some servers I have syslogd running, on others I have rsyslogd. Same goes with http vs apache2.

    What I would like to do is to have an item that goes like this

    proc.coun[apache2] + proc.count[httpd]

    This doesn't work. On the first item gets recorded, the second one is ignored.

    Better yet proc.count could take a regexp or a list so can do

    proc.count[http|apache2] and get a sum of processes named either apache2 or httpd


    Is there a way to do this?
    You can do it with calculated items http://www.zabbix.com/documentation/...lculated_items

    You need to create 3 items:
    • proc.count[apache2] : type Zabbix agent
    • proc.count[httpd] : type Zabbix agent
    • last("proc.count[apache2]")+last("proc.count[httpd]") : type calculated


    Hope this helps
    Alixen
    http://www.alixen.fr/zabbix.html

    Comment

    • timuckun
      Junior Member
      • Oct 2008
      • 9

      #3
      Did something similar but....

      Originally posted by alixen
      Hi,



      You can do it with calculated items http://www.zabbix.com/documentation/...lculated_items

      You need to create 3 items:
      • proc.count[apache2] : type Zabbix agent
      • proc.count[httpd] : type Zabbix agent
      • last("proc.count[apache2]")+last("proc.count[httpd]") : type calculated


      Hope this helps
      Alixen
      I had done something similar. I created the two items and then I created one alert based on both values being zero. The problem with that approach was that it created two alerts one for each item.

      This way only makes one trigger which is nicer.

      It does seem kind of odd though. I suppose I could write a client side script to do the count and only have one item but I don't like doing that.

      Comment

      • alixen
        Senior Member
        • Apr 2006
        • 474

        #4
        Hi,

        Originally posted by timuckun
        I had done something similar. I created the two items and then I created one alert based on both values being zero. The problem with that approach was that it created two alerts one for each item.

        This way only makes one trigger which is nicer.

        It does seem kind of odd though. I suppose I could write a client side script to do the count and only have one item but I don't like doing that.
        You don't need to create a calculated item if you only want a trigger that checks that one proc.count[apache2] or proc.count[httpd] is greater than 0.

        A trigger like:
        Code:
        {host:proc.count[apache2].last(0)}=0 & {host:proc.count[httpd].last(0)}=0
        should be enough.

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

        Comment

        • timuckun
          Junior Member
          • Oct 2008
          • 9

          #5
          Originally posted by alixen
          Hi,



          You don't need to create a calculated item if you only want a trigger that checks that one proc.count[apache2] or proc.count[httpd] is greater than 0.

          A trigger like:
          Code:
          {host:proc.count[apache2].last(0)}=0 & {host:proc.count[httpd].last(0)}=0
          should be enough.

          Regards,
          Alixen
          Yes that's what I had done. The problem is that creates two triggers for some reason and associates it with both items.

          BTW the calculated item is not working for some reason. I am still investigating why. Seems straighforward enough but for some reason it doesn't show up in the monitoring screens

          Comment

          • timuckun
            Junior Member
            • Oct 2008
            • 9

            #6
            Calculated item didn't work.

            The calculated item didn't work.

            I set it up in a template, the proc.count items are both zabbix agent active.

            The host says "not supported" on the calculated item even though the template says active.

            When I change it to active on the host it shows up on the latest data but with a "-" instead of the calculation.

            After a while it goes back to being "not supported".

            The formula is this.

            last("proc.count[httpd]")+last("proc.count[apache2]")

            I tried setting the key to different things but none of them worked.

            Comment

            Working...