I need to calculate the number of remote desktop sessions which are active across a pool of servers. However the number of the servers that are powered and running varies according to the time of day (i.e. all during peak times, some to few during off-peak).

I have a working Sensor Factory sensor totalling the source sensors successfully. However, as soon as even one single server is powered off, the results for the whole pool are returned as an empty value.

How can I get the Sensor Factory sensor to just assume a 0/nil value from a source sensor if the associated server is powered off?

Thanks Matthew


Article Comments

Hello,

Thank you very much for using PRTG. Just to check, is the option Calculate the factory channels and use zero as source value enabled in the Settings of the Factory Sensor?

best regards


Dec, 2014 - Permalink

Hi Torsten,

Yes, that's selected - doesn't appear to help.

If it's helpful, here's the formula:-

#1:total_sessions [Sessions]
channel(2352, 1) + 
channel(2363, 1) + 
channel(2364, 1) + 
channel(2362, 1) + 
channel(2442, 1) + 
channel(2428, 1) + 
channel(2429, 1) + 
channel(2369, 1) + 
channel(2370, 1) + 
channel(2366, 1) + 
channel(2445, 1) + 
channel(2435, 1) + 
channel(2373, 1) + 
channel(2456, 1) + 
channel(2461, 1) + 
channel(2457, 1) + 
channel(2459, 1) + 
channel(2460, 1) + 
channel(2393, 1) + 
channel(2430, 1) + 
channel(2431, 1) + 
channel(2432, 1) + 
channel(2433, 1) + 
channel(2411, 1) + 
channel(2434, 1) + 
channel(2395, 1) + 
channel(2412, 1) + 
channel(2436, 1) + 
channel(2426, 1) + 
channel(2410, 1) + 
channel(2422, 1) + 
channel(2437, 1) + 
channel(2424, 1) + 
channel(2438, 1) + 
channel(2421, 1) + 
channel(2440, 1) + 
channel(2423, 1) + 
channel(2441, 1) + 
channel(2425, 1)

It's pretty simple if a bit repetitive.


Dec, 2014 - Permalink

Can you please try if removing the line-breaks (in the Channel Definition for this Factory Sensor in PRTG) does help? Also which state are the source sensors in, in case a target server is powered off? Paused or error state?


Dec, 2014 - Permalink

I've removed the line-breaks - waiting to see if there's any difference.

I'm not sure where to look for a definition of the state the source sensor - this is what I get out of the summary line at the top of the screen (which is in red):

Connection could not be established (Port Error : RPC Server not accessible. - Host: <<HOSTNAME>>, User: <<USERACCOUNT>>, Password: **, Domain: ntlmdomain:<<DOMAINNAME>>) (code: PE015)

Is that what you're looking for?

On the sensor summary line it's got:

Last Scan: Last Up: Last Down: Uptime: Downtime: Coverage: Sensor Type: Dependency: Interval: ID: 88 s 16 h 22 m 88 s 45.0956% 54.9044% 100% WMI Terminal Services (Win2008) sensor Parent every 60 seconds

  1. 2431

Under channels it's returning "No data" for the Active & Total.


Dec, 2014 - Permalink

The red error message means the sensor is in down state. On the Factory Sensor, what is the "Error Handling" setting?


Dec, 2014 - Permalink

Removing the line breaks didn't make any difference.

For error handling, I've set to use a custom formula and supplied:

1>1

The intention is to force the sensor to believe it's never down.

It still returns 'No data'


Dec, 2014 - Permalink

The status formula is a bit more complicated here. A sensor in down state has a value of 10,000 for the downtime-channel, and this is what the status()-Function uses. So you need to write a formula similar to:

status(sensorA)+status(Sensorb) < 20000

In this small example for 2 sensors the Factory Sensor will only go into error state if all source sensors are down.


Dec, 2014 - Permalink

I tried this but it doesn't work - I've even simplified it down to just 2 servers:

Channel Definition:

  1. 1:total_sessions [Sessions] channel(2441, 1) + channel(2425, 1)

Error Handling: Use custom formula

Status Definition: status(2441) + status(2425) < 20000

If a Sensor has no data: Calculate the factory channels and use zero as source value

Outcome is logged as: Status="Up" Message="No data"

What can I do?

Thanks Matthew


Dec, 2014 - Permalink

Which version of PRTG are you using? I know that there was a version that had issues with PRTG filling in 0's for missing values and updating your installation may help.


Dec, 2014 - Permalink