<div dir="ltr"><div><div>Jeremy,<br><br></div>I changed my script using your advices.<br></div><div>It looks like this now:<br><br>::# Define the temp variable 'hostname'<br>@For /f "tokens=1" %%* in (<br>

    'hostname'<br>    ) Do @Set "hostname=%%*"<br><br>::# Define the temp variables 'Inbound and Outbound'<br>@for /f "tokens=2" %%* in (<br>    'netstat.exe -e ^| findstr /i "Bytes"'<br>

    ) do  @set "Inbound=%%*"<br>@for /f "tokens=3" %%* in (<br>    'netstat.exe -e ^| findstr /i "Bytes"'<br>    ) do  @set "Outbound=%%*"<br><br>::# Redirect output to a textfile<br>

@> "scripts\netstat" (<br>rem @echo green %Date% %time%<br>  @echo client %hostname%.win32<br>  @echo [netstat]<br>  @echo %hostname% %Inbound% %Outbound%<br>  )<br><br><br></div><div>This .bat script is creating the output: (My servers name is ghostwus)<br>

<br>client ghostwus.win32
<br>[netstat]
<br>ghostwus 65057048 3838258240<br><br></div><div>And indeed the message "reports netstat for an unknown OS" is gone and I got some client data:<br><br><pre>[collector:netstat]
status ghostwus.netstat client Tue Jun 25 23:17:17 CEST 2013
[netstat]
ghostwus 65874964 3838527680


 <font color=DarkSlateBlue >Xy-checkwin-2.0.1</font></pre>But still no graph... :-(<br><br></div><div>I changed the message output to <br><br>client ghostwus.win32
<br>[ifstat]
<br>ghostwus 65057048 3838258240<br><br></div><div>without any success.<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 25, 2013 at 5:07 AM, Jeremy Laidman <span dir="ltr"><<a href="mailto:jlaidman@rebel-it.com.au" target="_blank">jlaidman@rebel-it.com.au</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="im">On 25 June 2013 07:03, B-Art Gillis <span dir="ltr"><<a href="mailto:bacaselo@gmail.com" target="_blank">bacaselo@gmail.com</a>></span> wrote:<br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

Thank you for your answer but I just saw on the graph that the values are converted to rrd data seem to come from the "do_netstat.c" module.</blockquote></div><br></div>No, if you want interface statistics then you want ifstat parsed in do_ifstat.c.  If you want protocol statistics (layer 3 and above such as TCP and UDP) then you would want a [netstat] section parsed in do_netstat.c.  The message example you gave shows interface statistics.</div>


<div class="gmail_extra"><br></div><div class="gmail_extra">Xymon expects the format to match ifstat_bbwin_exprs[] (defined in do_ifstat.c). This includes an IP address then the in and out byte count.  The output of "netstat -e" does not provide an IP address, and it provides much more than just the bytes in and out.  You'd have to select the Bytes line and prefix it with an IP address (probably a dummy device name would do also).</div>


<div class="gmail_extra"><br></div><div class="gmail_extra">Something like:</div><div class="gmail_extra"><br></div><div class="gmail_extra">EthDev 144681781 42531845</div><div class="gmail_extra"><br></div><div class="gmail_extra">


Any whitespace can be used as separators (one or more tabs or spaces).</div><div class="gmail_extra"><br></div><div class="gmail_extra">You could probably get away with this:</div><div class="gmail_extra"><br></div><div class="gmail_extra">


echo [netstat] & netstat -e | find "Bytes"</div><div class="gmail_extra"><br></div><div class="gmail_extra">This would give "Bytes" as a devicename, but I don't think it would break anything.</div>


<div class="gmail_extra"><br></div><div class="gmail_extra">You need to prefix this message with the correct "client" message header.  If you're sending other client data, this should be included with that message, otherwise one will mask the other.</div>


<div class="gmail_extra"><br></div><div class="gmail_extra">The client message might look something like this:</div><div class="gmail_extra"><br></div><div class="gmail_extra">client server1.win32</div><div class="gmail_extra">


[netstat]</div><div class="gmail_extra">Bytes      144681781        42531845</div><div class="gmail_extra"><br></div><div class="gmail_extra">To get Xymon to match against the bbwin match string, you have to report your OS in the message as "bbwin" or "win32".  This is probably why you're getting the "reports netstat for an unknown OS" message.</div>
<span class="HOEnZb"><font color="#888888">

<div class="gmail_extra"><br></div><div class="gmail_extra">J</div><div class="gmail_extra"><br></div></font></span></div>
</blockquote></div><br></div>