WMI hide-no-result ...
 
Notifications
Clear all

WMI hide-no-result - 3.14

5 Posts
2 Users
0 Reactions
309 Views
Nathan_K
(@nathan_k)
Estimable Member Registered
Joined: 4 years ago
Posts: 131
Topic starter  

Found another quirk in 3.14, and that is an issue when WMI returns nothing, it doesn't hide the result. In the code block below, if IPv6 isn't returning info, I still have the "WAN IPv6 Latency" in the left column, even though the right column has no data and is blank.

WMI=interval:5,color:22ccee,text:WAN IPv6 Latency,namespace:root\cimv2,query:Win32_PingStatus where Address='ipv6.google.com', \
  chart:line2 scale:linear series1:%ResponseTime% color1:00ff00 threshold1:1 80 0000ff,hide-no-result:1,display:{{{Host: %Address% [%ProtocolAddress%]   Response Time: %ResponseTime%ms |%chart%}}}

   
Quote
Glenn
(@glenn)
Member Admin
Joined: 6 years ago
Posts: 1322
 

Posted by: @nathan_k

Found another quirk in 3.14, and that is an issue when WMI returns nothing, it doesn't hide the result. In the code block below, if IPv6 isn't returning info, I still have the "WAN IPv6 Latency" in the left column, even though the right column has no data and is blank.

WMI=interval:5,color:22ccee,text:WAN IPv6 Latency,namespace:root\cimv2,query:Win32_PingStatus where Address='ipv6.google.com', \
  chart:line2 scale:linear series1:%ResponseTime% color1:00ff00 threshold1:1 80 0000ff,hide-no-result:1,display:{{{Host: %Address% [%ProtocolAddress%]   Response Time: %ResponseTime%ms |%chart%}}}

The query is returning a row of data even when the ping fails so the hide-no-result option won't work. The triple curly braces are doing their job of suppressing the enclosed output if any of the enclosed return values are null, in this case probably %ResponseTime%.  Other return values contain data.

 

 


   
ReplyQuote
Nathan_K
(@nathan_k)
Estimable Member Registered
Joined: 4 years ago
Posts: 131
Topic starter  

@glenn - Ok, that makes sense. So how do I hide the whole thing if IPv6 isn't returning data? Like if the ProtocolAddress is blank due to not being able to be resolved? Or do I need to put the whole thing into a SET variable with HIDDEN:1, and then display all that with a follow up TEXT= section? Something like the following:

WMI=interval:5,color:22ccee,set:ipv6_latency,namespace:root\cimv2,query:Win32_PingStatus where Address='ipv6.google.com', \
  chart:line2 scale:linear series1:%ResponseTime% color1:00ff00 threshold1:1 80 0000ff,display:{{{Host: %Address% [%ProtocolAddress%]   Response Time: %ResponseTime%ms |%chart%}}},hidden:1
TEXT=interval:2,color:22ccee,text:WAN IPv6 Latency,display:%ipv6_latency%

   
ReplyQuote
Glenn
(@glenn)
Member Admin
Joined: 6 years ago
Posts: 1322
 

Here's what I came up with

 

WMI=interval:5, set:ipv6Address=%Address% ipv6ProtocolAddress=%ProtocolAddress% ipv6ResponseTime=%ResponseTime%,\
  namespace:root\cimv2,query:Win32_PingStatus where Address='ipv6.google.com',hidden:1

IF=value1:%ipv6ResponseTime%, comp:ne, value2:<null>
TEXT=interval:5,color:22ccee,text:WAN IPv6 Latency,\
     display:Host: %ipv6Address% [%ipv6ProtocolAddress%] |Response Time: %ipv6ResponseTime%ms |%chart%,\
     chart:line2 scale:linear series1:%ipv6ResponseTime% color1:00ff00 threshold1:1 80 0000ff

   
ReplyQuote
Nathan_K
(@nathan_k)
Estimable Member Registered
Joined: 4 years ago
Posts: 131
Topic starter  

@glenn - I'll give that a try. I always forget about the IF feature. That should help.


   
ReplyQuote
Glenn's Page