Ad Widget

Collapse

Custom net.tcp.service and how to not target loopback.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jrandolph
    Junior Member
    • May 2009
    • 12

    #1

    Custom net.tcp.service and how to not target loopback.

    I need to monitor a custom tcp port on multiple servers. Preferably I would like to do this using a template, but it seems to want to use Loopback as the IP for checking the service, and this particular service is not (and cannot) be bound to loopback and eth0 at the same time.

    Is there any way to adjust this in the zabbix_agentd.conf file rather than having to add the item and trigger by hand to every one of these servers?

    I'm sure this is rather rudimentary, and probably covered somewhere else, but after several hours of looking I'm starting to get a bit desperate.

    Halp!

    Thank you in advance!
    Last edited by jrandolph; 03-09-2009, 18:43. Reason: My poor spelling after low sleep.
  • richlv
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2005
    • 3112

    #2
    try
    Code:
    net.tcp.service[http,{IPADDRESS},80]
    Zabbix 3.0 Network Monitoring book

    Comment

    • jrandolph
      Junior Member
      • May 2009
      • 12

      #3
      Originally posted by richlv
      try
      Code:
      net.tcp.service[http,{IPADDRESS},80]
      So the answer is no. I cannot use a template for this?

      Comment

      • richlv
        Senior Member
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Oct 2005
        • 3112

        #4
        i'm sorry, why can't you ? that would exactly be the way to use it with templates - you create item like that in a template, link it to hosts and host ip address is used instead of some static, single value.
        Zabbix 3.0 Network Monitoring book

        Comment

        • jrandolph
          Junior Member
          • May 2009
          • 12

          #5
          Originally posted by richlv
          i'm sorry, why can't you ? that would exactly be the way to use it with templates - you create item like that in a template, link it to hosts and host ip address is used instead of some static, single value.
          The hosts have 3 ethernet cards on them.

          Outward facing system services on eth0, middle-tier (zabbix talks to host on this IP) and db services on eth1, and iSCSI on eth2.

          If I put in {ipaddress} how would Zabbix know to monitor the service using the IP on eth0, while still binding itself to eth1?

          Zabbix (in our environment) cannot talk to eth0 on the hosts.


          IE:
          eth0: 192.168.1.2:1500 (custom tcp service I need to monitor)
          eth1: 192.168.2.2 (IP zabbix talks to, middle-tier apps)
          eth3: 192.168.4.2 (iSCSI)

          Snippet of Zabbix config:
          Code:
          Server=192.168.2.250
          
          # Server port for sending active checks
          
          ServerPort=10051
          
          # Unique hostname. Required for active checks.
          
          Hostname=server01
          
          # Listen port. Default is 10050
          
          ListenPort=10050
          
          # IP address to bind agent
          # If missing, bind to all available IPs
          
          #ListenIP=127.0.0.1
          
          # Source IP address for outgoing connections
          Last edited by jrandolph; 04-09-2009, 16:41.

          Comment

          • richlv
            Senior Member
            Zabbix Certified Trainer
            Zabbix Certified SpecialistZabbix Certified Professional
            • Oct 2005
            • 3112

            #6
            ahhhh, that you should have told right away
            i'm not quite sure how this could be easily achieved with templates anyway.

            in your case maybe userparameters is the best solution then, next to manually setting service ip for each host.
            Zabbix 3.0 Network Monitoring book

            Comment

            • jrandolph
              Junior Member
              • May 2009
              • 12

              #7
              Yes, sorry I really should have.

              Unfortunately I was rather low on sleep when the initial query was written. It made perfect sense to me

              I don't suppose you have an userparameter example I could reference?

              Comment

              • richlv
                Senior Member
                Zabbix Certified Trainer
                Zabbix Certified SpecialistZabbix Certified Professional
                • Oct 2005
                • 3112

                #8
                well, not quite.

                but you'll need to add either direct commands, or wrapper script, to all agent config files where you will want to use this - see default config files for userparam examples.

                for getting ip address you could use some quick hack like /sbin/ifconfig eth0 | sed -n 's/.*inet addr:\([0-9.]*\).*/\1/ p', then perform whatever tests you want on it
                Zabbix 3.0 Network Monitoring book

                Comment

                Working...