Ad Widget

Collapse

icmp monitoring

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • farzin.mofarrah
    Junior Member
    • Oct 2018
    • 1

    #1

    icmp monitoring

    Hi experts,

    I just access to Server (B) via server(A), the Zabbix Server can just monitor server (A)
    how to monitor PING state of server (B) ?
  • ArtursL
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Nov 2018
    • 167

    #2
    Hi,
    If I'm understanding this right - you want to ping Host B from Host A? In that case, if your host A is running Linux, you should be able to invoke fping and pass the result via a user parameter.
    You can read more about how to define and configure user parameters here - https://www.zabbix.com/documentation...userparameters
    Here's a link to a post with a similar request. this should help you with figuring out Zabbix User Parameters - https://www.zabbix.com/forum/zabbix-...-agent?t=20592

    Comment


    • farzin.mofarrah
      farzin.mofarrah commented
      Editing a comment
      Hi,
      Actually both host are running Windows, but Zabbix server has access Host A, I'm thing of a PHP script or sth like that !
  • ArtursL
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Nov 2018
    • 167

    #3
    You can still use User parameters to do what you need - just create a simple bat file that outputs either 1 or 0 depending on if the pinging from host A to host B succeeds or fails, point the user parameter to the file and create the corresponding item and trigger.

    Comment


    • farzin.mofarrah
      farzin.mofarrah commented
      Editing a comment
      I just crated a batch file like this :
      ping -n 1 192.168.237.62 | find "TTL" & if not errorlevel 1 set error=1 & if errorlevel 1 set error=0
      and copied that to HOST A Drive c: (root)

      I just added this "UserParameter=Ping_Datacenter_Servers, c:/ping.bat" to zabbix_agentd.conf

      still no data back !


      PS : the IP: 192.168.237.62 refers to HOST B
      Last edited by farzin.mofarrah; 24-11-2018, 14:24.
  • Semiadmin
    Senior Member
    • Oct 2014
    • 1625

    #4
    You may avoid the creation of user parameter using WMI. For example:
    wmi.get[root\cimv2,select StatusCode from Win32_PingStatus where Address="ip" and Timeout=1000]
    Item value 0 means success. This method is preferred for ping by ip, because for ping by name such item will become not supported in case of DNS problems.

    Comment


    • farzin.mofarrah
      farzin.mofarrah commented
      Editing a comment
      Unfortunately Zabbix server can't access to Host B directly,
      Actually Host A & B are in same network (192.168.x.x) and Zabbix serve just access to Host A as a NAT IP (172.27.x.x)
      There is no way from Zabbix server to Host B Even with WMI Protocol

      in your example there is just ONE IP address that can access via Zabbix server right ?
  • ArtursL
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Nov 2018
    • 167

    #5
    What do you mean by "No data"? Is there an error you're getting in Zabbix? Is the script outputting the correct value - number or text? You should try running the script and checking if the value that it's displaying is as it should be.

    Comment


    • farzin.mofarrah
      farzin.mofarrah commented
      Editing a comment
      No data" i mean nothing will log by Zabbix, there is no error, the problem was in batch file name !!
      it seems it's not allowed to make a batch file like this "ping.bat", i just renamed to "png.bat" that problem solved
      but still have some other problem :

      [root@localhost ~]# zabbix_get -s 172.27.0.183 -k custom.ping
      zabbix_get [27812]: Get value error: ZBX_TCP_READ() failed: [104] Connection reset by peer
      zabbix_get [27812]: Check access restrictions in Zabbix agent configuration


      tnx.
  • Semiadmin
    Senior Member
    • Oct 2014
    • 1625

    #6
    Hi, farzin.mofarrah.
    I mean windows agent's item wmi.get. The item created on the host A and has ip of the host B in the key: wmi.get[root\cimv2,select StatusCode from Win32_PingStatus where Address="192.168.x.x"]

    Comment


    • farzin.mofarrah
      farzin.mofarrah commented
      Editing a comment
      I got this error after using wmi
      /usr/lib/zabbix/externalscripts/wmi.get: [2] No such file or directory

      where to get that script ?
      Last edited by farzin.mofarrah; 26-11-2018, 14:52.
  • ArtursL
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Nov 2018
    • 167

    #7
    You could try taking another look at your agent configuration in zabbix_agentd.conf - check if you have the correct server IP set there and that there are no network/firewall related restrictions regarding ports/services.

    Comment

    • Semiadmin
      Senior Member
      • Oct 2014
      • 1625

      #8

      wmi.get[<namespace>,<query>]

      Comment

      Working...