Ad Widget

Collapse

Item to return number of hosts in group

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • imoskovko
    Junior Member
    • Jan 2015
    • 6

    #1

    Item to return number of hosts in group

    Hello

    It seams to be not the big deal but i am unable to get working item that return number of hosts in group. Hosts are being discovered automaticaly and removed from group also automaticaly after 2 weeks of inactivity.

    I am trying to use something like aggregate check on Zabbix server

    grpsum["Host_Group","vfs.file.exist[/etc/hosts]",last,0]

    But it accept it, produce no error but returns no data.

    Ane thing it that all hosts in this group are active agents only.
    Can one suggest how to do it without direct sql query to database.

    Regards,
    Igor
  • imoskovko
    Junior Member
    • Jan 2015
    • 6

    #2
    ok i tryed to create zabbix internal item on all hosts of "Host Group" as "Agent-Check"

    zabbix[host,"agent",available]

    then on zabbix server aggregate iutem

    grpsum["Host Group",Agent-Check,last,0]

    but aggregate item complains
    No items for key "Agent-Check" in group(s) "Host Group".

    Comment

    • imoskovko
      Junior Member
      • Jan 2015
      • 6

      #3
      solution

      OK finaly it worked as

      1)
      AgtCheck
      zabbix[host,"agent",available]
      as zabbix internal on hosts in group "HostGroup"

      2) then
      aNumAgt
      as Zabbix aggregate

      grpsum["HostGroup","zabbix[host,\"agent\",available]",last,0]


      but it actualy does not show unavalable (turned of ) hosts, i need to think about it ......

      Comment

      • janssenreis
        Member
        • May 2010
        • 64

        #4
        Use the API to it. You will have less work.



        After collecting the data you want, create an item with User Parameter or using zabbix_sender.

        Att,

        Janssen dos Reis Lima
        Blog focado em ferramentas e tecnologias na área de administração de sistemas

        Comment

        • imoskovko
          Junior Member
          • Jan 2015
          • 6

          #5
          Thank you Janssen !
          https://www.zabbix.com/documentation/2.4/manual/api looks very interesting and has many useful things.
          Perl libs will do fine for me to start with it.

          Regards,
          Igor
          Last edited by imoskovko; 26-01-2016, 21:29.

          Comment

          Working...