Welcome to Pandora FMS Community!

Find answers, ask questions, and connect with our community around the world.

Welcome to Pandora FMS Community Forums Community support Better way to ping from a agent?

  • Better way to ping from a agent?

    Posted by RPICARD on June 10, 2008 at 04:43

    Because most of my clients have a small office I cannot put a Pandora server in each location and have a full SNMP setup, but I did want to make sure printers were ‘on’. Since I’m not using SNMP the only method I could find was to ping the server but I am using a Windows agent to do basic monitoring of that server and related resources.

    I tred using ‘generic_icmp_proc’ but it didnt seem to work, so I built my own ‘ping’ tool. I used a 3rd party ping comamnd, called fping as Windows Server 2003, XP, Vista, 2008 display ping results in a different way. Example below is for my a older HP5Si

    module_begin
    module_name printerHP5SiBack
    module_type generic_proc
    module_exec fping 192.168.128.138 -n 1 -l | grep “Reply” | wc -l
    module_description Check to see if HP 5Si replies to Ping
    module_end

    Is there a more efficient way of doing this?

    Lastly, does anyone have any other tips for the Windows Agent?

    TurricanII replied 16 years, 8 months ago 3 Members · 2 Replies
  • 2 Replies
  • raul

    Member
    June 10, 2008 at 14:08
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    You can utilize Pandora Network Server: Take a look at http://openideas.info/wiki/index.php?title=Pandora_1.3:Documentation_en:Basic_Setup#Network_Modules

    Raul

  • TurricanII

    Member
    June 11, 2008 at 21:04
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    I use a lot of VBS scripts on Windows. Save this as a text file called Ptest.vbs in UTILS:

    [code:1]Dim sHost ‘name of Windows XP computer from which the PING command will be initiated
    Dim sTarget ‘name or IP address of remote computer to which connectivity will be tested
    Dim cPingResults ‘collection of instances of Win32_PingStatus class
    Dim oPingResult ‘single instance of Win32_PingStatus class

    sHost = “.”

    Dim objArgs
    Set objArgs = Wscript.Arguments
    if objArgs.Count 1 then
    WScript.StdOut.Write “BAD IP”
    WScript.Quit (1)
    End If
    sTarget = objArgs(0)

    Set cPingResults = GetObject(“winmgmts:{impersonationLevel=impersonate}//” & _
    sHost & “/root/cimv2”). ExecQuery(“SELECT * FROM Win32_PingStatus ” & _
    “WHERE Address = ‘” + sTarget + “‘”)

    For Each oPingResult In cPingResults
    If oPingResult.StatusCode = 0 Then
    WScript.StdOut.Write oPingResult.ResponseTime
    Else
    WScript.StdOut.Write “-1”
    End If
    Next

    Then add this to your pandora.conf:

    [code:1]# Response time for HP Laser
    module_begin
    module_name Response time for HP Laser
    module_type generic_data
    module_exec cscript //NoLogo “C:Program FilesPandora_AgentutilPTEST.vbs” 192.168.1.201
    module_description Response time for HP Laser
    module_end

    This will give you a graph of response times pinging that IP. A value of -1 wil be returned if the ping fails, so you can set an alert on the basis that a minimum ping response time should be 0 and maximum should be 20 or 30 on the LAN. You can also use this ping test to monitor VPN’s etc. etc.