Ad Widget

Collapse

monitoring multiple services on with macros

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sg42
    Member
    • Mar 2015
    • 32

    #1

    monitoring multiple services on with macros

    Hi!

    Some services have runs not allways under the same tcp-port (e.g. http on 8000 instead 80).
    So I have created a template with a macro {$HTTP_PORT} which is default-setting is 80. So when I have a web-server on another port, I don't have to create another Template.
    So far, so good. But what can I do, if there are multiple web-servers on one node?
    Can I add the same Template more than one time to a node?

    TIA,
    Stephan
  • coreychristian
    Senior Member
    Zabbix Certified Specialist
    • Jun 2012
    • 159

    #2
    No, a single host on the zabbix server can't have items with duplicate keys.

    Comment

    • sg42
      Member
      • Mar 2015
      • 32

      #3
      Originally posted by coreychristian
      No, a single host on the zabbix server can't have items with duplicate keys.
      Do You have another idea, how to solve this problem? I don't want to create multiple identical items which only differs in one point, the tcp-port.

      Can macros contain arrays?

      Comment

      • aib
        Senior Member
        • Jan 2014
        • 1615

        #4
        Please, think about it: When you get a message about "Service DOWN", would you like to have an information, Which port was served by that service?
        And in the end of month - Would you like to have summary about which server falls down more often and when?

        If you answer yes - it means that you have to save all information about each service under control. You need an individual Item for each server. Period.

        Sorry for cluttering your configuration, but it's only one way to save information about each service.
        Sincerely yours,
        Aleksey

        Comment

        • sg42
          Member
          • Mar 2015
          • 32

          #5
          Thanks for Your explanation. It helps me to understand the 'philosophy' of zabbix a little bit more.
          When I create templates I have DRY (don't repeat yourself) in mind. I thought it is better to create one item for multiple similar checks (http on port x) than different items for each check (http on port 80, http on port 8000, http on port 8080...)
          OK, I will redesign my Templates

          Comment

          • aib
            Senior Member
            • Jan 2014
            • 1615

            #6
            Originally posted by sg42
            Thanks for Your explanation. It helps me to understand the 'philosophy' of zabbix a little bit more.
            When I create templates I have DRY (don't repeat yourself) in mind. I thought it is better to create one item for multiple similar checks (http on port x) than different items for each check (http on port 80, http on port 8000, http on port 8080...)
            OK, I will redesign my Templates
            Well, it's remind me Discovery part of any template.
            If you have the special attribute to check if that service answer/works, you can create One DIscrovery rule with One Item prototype.
            After connecting template to your host, Discovery rule will automatically create as many Items/Triggers/Graphs as many can be found by checking attributes.

            May be it can help you to reduce manual job?
            Sincerely yours,
            Aleksey

            Comment

            • coreychristian
              Senior Member
              Zabbix Certified Specialist
              • Jun 2012
              • 159

              #7
              Thanks for stepping in Aleksey.

              I was going to mention, the only reliable way I could think of getting the proper port would be to write a script that zabbix could use in LLD to create the appropriate items/triggers.

              You could attempt to do something with duplicate hosts, but that really becomes a nightmare and wouldn't be much different then just creating multiple templates.
              Last edited by coreychristian; 16-03-2015, 16:11.

              Comment

              • sg42
                Member
                • Mar 2015
                • 32

                #8
                Thank again for Your answers. After two weeks vacation I will look in discovery/script writing. I will write a solution (if I find one)

                Comment

                Working...