[Xymon] rrd network graphs on windows check

B-Art Gillis bacaselo at gmail.com
Fri Jun 28 15:45:49 CEST 2013


Hi Jeremy,

Thank you for your help and feedback.
Having this extra knowledge I took a closer look at the output of the
netstat result of the BBWin agent and discovered that the network graphs
are generated by the "nestat -s" command.
So I redesigned my script so that it now generates exactly the same output
for the "netstat" check as BBWin does.
And as expected, I now get the rrd files that are giving me the graphs of
the TCP/IP statistics.
I didn't managed to create the interface rrd files through ifstat but these
protocol statistics are just fine.

Here my script:

echo off
SETLOCAL ENABLEDELAYEDEXPANSION
SET count=1
FOR /F "tokens=2 USEBACKQ delims==" %%F IN (`netstat -s`) DO (
  SET var!count!=%%F
  SET /a count=!count!+1
)
::# Redirect output to a textfile
@> "scripts\netstat" (
  @echo green %Date% %time%
  @echo win32
  @echo    PacketsReceived=%var1%
  @echo    ReceivedHeaderErrors=%var2%
  @echo    ReceivedAddressErrors=%var3%
  @echo    DatagramsForwarded=%var4%
  @echo    UnknownProtocolsReceived=%var5%
  @echo    ReceivedPacketsDiscarded=%var6%
  @echo    ReceivedPacketsDelivered=%var7%
  @echo    OutputRequests=%var8%
  @echo    RoutingDiscards=%var9%
  @echo    DiscardedOutputPackets=%var10%
  @echo    OutputPacketNoRoute=%var11%
  @echo    ReassemblyRequired=%var12%
  @echo    ReassemblySuccessful=%var13%
  @echo    ReassemblyFailures=%var14%
  @echo    DatagramsSuccessfullyFragmented=%var15%
  @echo    DatagramsFailingFragmentation=%var16%
  @echo    FragmentsCreated=%var17%
  @echo.
  @echo    tcpActiveOpens=%var18%
  @echo    tcpPassiveOpens=%var19%
  @echo    tcpFailedConnectionAttempts=%var20%
  @echo    tcpResetConnections=%var21%
  @echo    tcpCurrentConnections=%var22%
  @echo    tcpSegmentsReceived=%var23%
  @echo    tcpSegmentsSent=%var24%
  @echo    tcpSegmentsRetransmitted=%var25%
  @echo.
  @echo    udpDatagramsReceived=%var26%
  @echo    udpNoPorts=%var27%
  @echo    udpReceiveErrors=%var28%
  @echo    udpDatagramsSent=%var29%
  )
ENDLOCAL


On Wed, Jun 26, 2013 at 4:18 AM, Jeremy Laidman <jlaidman at rebel-it.com.au>wrote:

> On 26 June 2013 07:29, B-Art Gillis <bacaselo at gmail.com> wrote:
>
> > But still no graph
>
> Is there an RRD file?  Is there anything interesting in the rrd-data.log
> file?
>
> Bear in mind that (unless run with the --no-cache switch) xymond_rrd
> doesn't update the RRD file immediately, and instead caches updates for a
> period of time (up to 30 minutes).
>
> In my experience, viewing a graph seems to cause xymond_rrd to flush its
> cache, so if you're only looking for updates in the RRD file directly, you
> might not see new data come in straight away.  But if you're looking at
> graphs, you're probably triggering a cache flush anyway.
>
> Where are you looking for the graph?  There might be a delay in the graph
> showing up in the trends page, so what I usually do is to click another
> graph for the same host, and then change the URL to point at the graph I'm
> looking for.  For example, click on the "CPU Load" (load average = "la")
> and then change the "la" in the URL to "ifstat".
>
>
>> client ghostwus.win32
>> [ifstat]
>> ghostwus 65057048 3838258240
>>
>
> BBWin presents an IP address in the first field (rather than a hostname).
>  My review of the do_ifstat.c code indicated that a hostname would probably
> be fine, but there could be other bits of code that reject the message
> before (or after) it gets to this point.
>
> So I would try adjusting the message so that the IP address of the
> interface (or any IP address, for testing) is used instead of the hostname.
>  Even 0.0.0.0 would be a reasonable test.
>
> Also, could be worthwhile running client and data channel inspectors at
> the same time as you send the message (in separate windows).  Here's what I
> would use:
>
> sudo -u xymon xymoncmd xymond_channel --channel=client grep -A10
> ^@@.*ghostwus
> sudo -u xymon xymoncmd xymond_channel --channel=data grep -A10
> ^@@.*ghostwus
>
> The first command will show the first 10 lines of any client message that
> come from (or contain in their header) "ghostwus".
>
> The second command will match any data messages from same, and you should
> see an "ifstat" message possibly among others.  The data message is
> generated by the xymond_client process that takes the client messages,
> parses them (using the code in do_ifstat.c) and creates the data messages.
>
> The flow goes like this:
>
> windows --(client message)--> xymond --(client channel)--> xymond_client
> --(data channel)--> xymond_rrd --> rrdfile
>
> If you're getting the client message but not the data message, then the
> problem is somewhere in xymond_client.  Look in the clientdata.log file.
>  If you're getting the data messages, it could be something else, like a
> permissions problem on the RRD directory, or the xymond_rrd process isn't
> running.  Look in the rrd-data.log file.
>
> Cheers
> Jeremy
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20130628/6667cfea/attachment.html>


More information about the Xymon mailing list