Ad Widget

Collapse

icmp item problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • harv3n
    Junior Member
    • Sep 2017
    • 6

    #1

    icmp item problem

    Hello everyone,
    first: my english is rusty. p

    I got a trouble with an item based on icmp.
    my job bring me to zabbix, we have 6 shoppings connected and all of these connecting to a DC.
    my problem start here.
    one of my items consist in monitoring the latency all of these shoppings of SHOP > Internet and SHOP > DC.
    its run ok, but not exactly.
    The item return me a result as if send by Zabbix Server.
    Example:
    Directly from Shop1
    Shop1 to internet 23ms
    Shop1 to DC 6ms

    and from zabbix item
    Shop1 to internet 60ms
    shop1 to dc 20ms

    And my output of zabbix server are directly to internet and secondary to wan, instead of shoppings, where the default output is a router to a wan.

    i need a item to that bring me the latency of Host>DC | Host>Internet directly from host.
    Its possible with icmppingsec? or just with remote commands?

    Thanks a lot!
  • allexpetrov
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2017
    • 361

    #2
    Hi,
    yes you are completely right. The icmp checks are performed by Zabbix server to the host, but not from host. You can perform the SSH connection with specific commands and then you will receive the result back.

    Regards,
    Alex!

    Comment

    • harv3n
      Junior Member
      • Sep 2017
      • 6

      #3
      Hello and thanks for reply!

      the ssh solution,
      i saw something about this, running commands with ssh, return that a similar result when i do external scripts or userparameters command?

      if i add proxies in each place where i need to monitor, can i ping to a destination from zabbix proxy?

      thanks again!

      Comment

      • allexpetrov
        Senior Member
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • May 2017
        • 361

        #4
        Yes, you can do it with proxy. So if you can put a proxy there - this would be a solution. But after the proxy you need to create the endpoints of those ICMP packets and put them "behind" proxy.

        Regards,
        Alex!

        Comment

        • SBO
          Zabbix Certified Specialist
          Zabbix Certified Specialist
          • Sep 2015
          • 226

          #5
          If you have a zabbix agent on each site, you can configure a UserParameter that will ping your DC, and get the result on your server

          Comment

          • harv3n
            Junior Member
            • Sep 2017
            • 6

            #6
            but the output give to me a string, no?
            example when make a ping to 8.8.8.8 and this return "Response of 8.8.8.8: etc etc etc"
            has zabbix a way to get ping latency constantly? like icmppingsec but from host to destination

            Thanks for reply!

            Comment

            • SBO
              Zabbix Certified Specialist
              Zabbix Certified Specialist
              • Sep 2015
              • 226

              #7
              UserParameter=ping.dc,ping -c 4 IP-OF-YOUR-DC | tail -1 | awk '{print $4}' | cut -d '/' -f 2

              it should do the trick

              Comment

              • harv3n
                Junior Member
                • Sep 2017
                • 6

                #8
                wow, nice!!! it worked clean!
                thank u dude!

                Comment

                • allexpetrov
                  Senior Member
                  Zabbix Certified Trainer
                  Zabbix Certified SpecialistZabbix Certified Professional
                  • May 2017
                  • 361

                  #9
                  Hi,
                  yes! This will definitely work (but id on't understand why you want to perform all 4 icmps if you need only one in this case) but also you need to understand that you will receive character-value, not numeric.
                  If you want numeric - install proxy. Proxy is a very tiny and don't use much of ram or drive space.

                  Also, i would like to suggest you to use float userparameters, because they are more customizable and this could help in the future. Try something like this:

                  Code:
                  UserParameter=floatping[*],ping -c 1 $1 | grep -Po 'time=\K[\d.]+'
                  This will take your value, defined in frontend, (example - floatping[8.8.8.8] or any other [value]) and will put instead of $1. This could be very helpful as well as creating items like icmp $1 will make your item name be like icmp [value]

                  Regards,
                  Alex!
                  Last edited by allexpetrov; 11-09-2017, 08:05.

                  Comment

                  • harv3n
                    Junior Member
                    • Sep 2017
                    • 6

                    #10
                    my shopps are located in different countries and each one with different providers, so, we need to monitor constantily.

                    i was thinking to make something to convert a numeric return, with python, or other.
                    ur code work clean too, and easy to understand, i'll try this too.
                    Thank u!

                    Comment

                    • allexpetrov
                      Senior Member
                      Zabbix Certified Trainer
                      Zabbix Certified SpecialistZabbix Certified Professional
                      • May 2017
                      • 361

                      #11
                      Use this .sh script, put it in cron and this should do the trick with numeric characters

                      Read the script, there is a variable for zabbix server and also there is some manipulation with zabbix_get.

                      Regards,
                      Alex!
                      Attached Files

                      Comment

                      Working...