Jump to content

Recommended Posts

Posted

I've been playing with the uptime tiles feature and following the instructions in the userguide have added one for our main server. It shows that the server is down but the server is definately working as the VM for HAP+ runs on this server. It even says the localhost server is down whether I use IP or netbios or FQDN.

 

Any ideas how I get these working. HAP+ VM is running server 2008R2 and is a member server in the domain. All other features work fine just the live uptime tiles.

 

Thanks

Posted

This is the code the uptime api uses:

            TimeSpan t = new TimeSpan(0);
           hapConfig config = hapConfig.Current;
           User user = new User();
           user.Authenticate(config.AD.User, config.AD.Password);
           try
           {
               user.ImpersonateContained();
               PerformanceCounter pc = new PerformanceCounter("System", "System Up Time", "", server);
               pc.NextValue();
               t = TimeSpan.FromSeconds(pc.NextValue());
           }
           catch
           {
           }
           finally
           {
               user.EndContainedImpersonate();
           }
           return t;

So as you can see it uses the AD Admin account to get a performance counter on the remote PC. If the AD user that HAP uses doesn't have permission it will fail, or if performance counters are disabled on the remote pc

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...