[Xymon] Xymon PowerShell Windows client

Brandon Dale BDale at kitchengroup.com.au
Wed Mar 4 10:58:14 CET 2015


I added in bbwin identifier and those two graphs started to appear.


This is what I have under ifstat with ipv6 enabled.

[ifstat]
fe80::25a5:b99d:55cd:951f%12 2677339075 541438677
10.250.100.163 2677339075 541438677
::1 0 0
127.0.0.1 0 0

This is what ends up on the graph, , the ipv6 address with the % symbol doesn’t display which might be a problem for some.

[cid:image001.png at 01D056B7.8B4B5BC0]


I also changed the xymonifstat function on line 1895 in the ps client to get rid of the loop back addresses.

function XymonIfstat
{
    WriteLog "XymonIfstat start"
    "[ifstat]"
    [System.Net.NetworkInformation.NetworkInterface]::GetAllNetworkInterfaces() | ?{($_.OperationalStatus -eq "Up") -and ($_.NetworkInterfaceType -ne "loopback")} | %{
        $ad = $_.GetIPv4Statistics() | select BytesSent, BytesReceived
        $ip = $_.GetIPProperties().UnicastAddresses | select Address
        # some interfaces have multiple IPs, so iterate over them reporting same stats
        $ip | %{ "{0} {1} {2}" -f $_.Address.IPAddressToString,$ad.BytesReceived,$ad.BytesSent }
    }
    WriteLog "XymonIfstat finished."
}

Output is:

[ifstat]
fe80::25a5:b99d:55cd:951f%12 2678370580 543079717
10.250.100.163 2678370580 543079717

And now I don’t see the loopback addresses on the graph which “looks” better.

[cid:image002.png at 01D056BD.14C7A3E0]


Regards,


Brandon

From: zak.beck at accenture.com [mailto:zak.beck at accenture.com]
Sent: Wednesday, 4 March 2015 7:48 PM
To: jlaidman at rebel-it.com.au; Brandon Dale
Cc: xymon at xymon.com
Subject: RE: [Xymon] Xymon PowerShell Windows client

Hi

Unfortunately, you can't fake the BBWin identifier for just one section – you have to change the client to report in as BBwin. It was changed so that we could experimentally use separate configuration options for BBWin clients and Powershell clients.

To change how the client reports itself, change line 2746 in the current commit:

2745    WriteLog "Performing main and optional tests and building output..."
2746    $clout = "client " + $clientname + ".powershell powershell XymonPS" | Out-String
2747    $clsecs = XymonClientSections | Out-String

In the original Powershell client, this line was:

                $clout = "client " + $clientname + ".bbwin win32" | Out-String

So you can see we've changed '.bbwin' to '.powershell' and 'win32' to 'powershell'.

I appreciate this isn't very good and should probably be a configuration item.

[netstat] uses the output from netstat -s, but it appears the parsing is not very clever. [ifstat] uses a .Net object to pull out interface information. I haven't changed the code that generates either of these sections – quite likely it needs some work! I'll add it to the list.
Zak

From: Jeremy Laidman [mailto:jlaidman at rebel-it.com.au]
Sent: 04 March 2015 06:24
To: Brandon Dale
Cc: Beck, Zak; xymon at xymon.com<mailto:xymon at xymon.com>
Subject: Re: [Xymon] Xymon PowerShell Windows client

On 4 March 2015 at 13:26, Brandon Dale <BDale at kitchengroup.com.au<mailto:BDale at kitchengroup.com.au>> wrote:
3.       On a windows machine running PowerShell client v1.98 I don’t get any network related graphs however I seem to have data available:

a.       [ifstat] contains data e.g


[ifstat]

fe80::25a5:b99d:55cd:951f%12 2655878237 519887923

10.250.100.163 2655878237 519887923

Yep, this should be parseable by Xymon.  In principle.


At the moment I’m guessing the ifstat data isn’t in a format xymon will automatically graph and add to the trends page

Xymon will parse the [ifstat] data from a Windows machine, if it's in a suitable format.  From the source code, the regexp for this is:

        ^([a-zA-Z0-9.:]+)\s+([0-9]+)\s+([0-9]+)

I note that in the first [ifstat] line above, there's a percentage sign in the first token, which doesn't match the regexp.  I don't know of Xymon continues on looking for other lines to match, or if it rejects the whole [ifstat] section as corrupt.  But I wonder what would happen if the IPv6 address wasn't in the [ifstat] client data.  Any chance you can unbind IPv6 for testing?

Another thing to note is that some of the "powershell" processing in Xymon just re-uses the "bbwin" processing.  But there are some bits of parsing code, including for "ifstat" it seems, that only look for the bbwin OS string, and I can't see any place in the powershell handling code that tries to fake the bbwin OS for ifstat.  In other words, could be that the code simply isn't there to do what you want.  But it might also be the case that adjusting the powershell client to report itself as the bbwin client might do the trick.

J

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20150304/be53af6c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 24250 bytes
Desc: image001.png
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20150304/be53af6c/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 3383 bytes
Desc: image002.png
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20150304/be53af6c/attachment-0001.png>


More information about the Xymon mailing list