Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 664

Get all network adapter IP

$
0
0
Hello everyone,

I'm currently making a skin to deploy on over 7000 computers with over 100 different hardware. One thing we want is to show all NIC that have an IP, let it be wireless, vpn, wired or cellular. I came up with a solution to show 3, but I found it very bad. I'ts just looping forever until it find one and I'm wondering if there's a better way.

Code:

[Variables]SecondInterface=1ThirdInterface=2[MeasureIP1]Measure=SysInfo#Plugin=SysInfoGroup=IPInfoSysInfoType=IP_ADDRESSSysInfoData=BestDynamicVariables=1IfMatch=^127.0.0.1$|^0.0.0.0$IfMatchAction=[!SetOption meterValueIP1Off Hidden 0][!SetOption meterValueIP1 Hidden 1][!UpdateMeasureGroup IPInfo]IfNotMatchAction=[!SetOption meterValueIP1Off Hidden 1][!SetOption meterValueIP1 Hidden 0][!UpdateMeasureGroup IPInfo];IfMatchAction=[!ToggleMeter "meterLabelIP1"][!ToggleMeter "meterValueIP1"][!UpdateMeasureGroup IPInfo][MeasureIP2]Measure=SysInfoGroup=IPInfoSysInfoType=IP_ADDRESSSysInfoData=#SecondInterface#DynamicVariables=1IfCondition=#SecondInterface# > 50IfTrueAction=[!SetVariable SecondInterface 1][!UpdateMeasureGroup IPInfo]IfMatch=^127.0.0.1$|^0.0.0.0$|^$|^[MeasureIP1]IfMatchAction=[!SetVariable SecondInterface (#SecondInterface#+1)][!SetOptionGroup "IP2" Hidden 1][!SetOption meterLabelIP2 Y 0r]IfNotMatchAction=[!SetOptionGroup "IP2" Hidden 0][!SetOption meterLabelIP2 Y 25r]IfMatchMode=1[MeasureIP3]Measure=SysInfoGroup=IPInfoSysInfoType=IP_ADDRESSSysInfoData=#ThirdInterface#DynamicVariables=1IfCondition=#ThirdInterface# > 50IfTrueAction=[!SetVariable ThirdInterface 1][!UpdateMeasureGroup IPInfo]IfMatch=^127.0.0.1$|^0.0.0.0$|^$|^[MeasureIP1]|^[MeasureIP2]IfMatchAction=[!SetVariable ThirdInterface (#ThirdInterface#+1)][!SetOptionGroup "IP3" Hidden 1][!SetOption meterLabelIP3 Y 0r]IfNotMatchAction=[!SetOptionGroup "IP3" Hidden 0][!SetOption meterLabelIP3 Y 25r]IfMatchMode=1
thank you

Statistics: Posted by nodiaque — Yesterday, 12:00 pm — Replies 2 — Views 70



Viewing all articles
Browse latest Browse all 664

Trending Articles