[Xymon] Xymon PowerShell Windows client

zak.beck at accenture.com zak.beck at accenture.com
Wed Mar 4 16:16:14 CET 2015


Hi

 

Thanks for the patch.

 

Regarding the BBwin / powershell identifier, my proposal is to default to bbwin but to allow this to be overridden using the local client XML config – does this sound reasonable?

 

The %<number> stuff is the zone index (https://en.wikipedia.org/wiki/IPv6_address#Link-local_addresses_and_zone_indices) – i.e. the adaptor number.

 

I'm not sure how useful this is to Xymon and could probably be removed with a slight amendment to your patch like the following:

 

 

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 –replace '%\d+'), $ad.BytesReceived,$ad.BytesSent }

    }

    WriteLog "XymonIfstat finished."

} 

 

I have not tested this but I think it should work.

 

Thanks

Zak Beck
Infrastructure Tech Support Specialist
Accenture
Tel: +44 (0) 1785 764609
Email: zak.beck at accenture.com <mailto:zak.beck at accenture.com> 

Upcoming PTO (leave): Feb 20th, April 7th-10th, Jul 3rd, Jul 24th-Aug 10th 

Our core values: Stewardship - Best People - Client Value Creation - One Global Network - Respect for the Individual - Integrity

This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.

Accenture means Accenture (UK) Limited (registered number 4757301), registered in England and Wales with registered address at 30 Fenchurch Street, London EC3M 3BD.

 

From: Brandon Dale [mailto:BDale at kitchengroup.com.au] 
Sent: 04 March 2015 09:58
To: Beck, Zak; jlaidman at rebel-it.com.au
Cc: xymon at xymon.com
Subject: RE: [Xymon] Xymon PowerShell Windows client

 

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.

 



 

 

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.

 



 

 

Regards, 

 

 

Brandon 

 

From: zak.beck at accenture.com <mailto: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 <mailto:jlaidman at rebel-it.com.au> ; Brandon Dale
Cc: xymon at xymon.com <mailto: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/63941204/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 24250 bytes
Desc: not available
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20150304/63941204/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 3383 bytes
Desc: not available
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20150304/63941204/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6831 bytes
Desc: not available
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20150304/63941204/attachment.bin>


More information about the Xymon mailing list