Windows Active Sessions
Jim Avery
jim at jimavery.me.uk
Mon Jan 23 14:42:47 CET 2012
On 23 January 2012 13:09, Robert Jackson <rab at walkermartyn.co.uk> wrote:
> Does anyone know how to return the number of active sessions from a Windows
> Terminal server? I have installed the NSClient++ service on the Windows
> server and obviously have the NRPE plugin installed on my Nagios host.
Rab,
if I've understood correctly then you can query a Windows performance counter.
I use an entry in the NSClient++ config file in the [External Alias]
section that looks like this:-
alias_CheckCounter-ts_act_sess=CheckCounter
"Counter:sessions=\Terminal Services\Active Sessions" ShowAll
MaxWarn=40 MaxCrit=50
Then on the Nagios side, the command is simply check_nrpe -H
thehostname -c alias_CheckCounter-ts_act_sess
So the command definition in Nagios is:-
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -u $ARG1$
}
And the service definition looks something like this:-
define service{
use srv-pnp,generic-service
host_name myhost
service_description TS_Active_Sessions
check_command check_nrpe!-c ts_act_sess
notes Number of Terminal Services Active Sessions
contact_groups notify-engineers
}
There are lots of similar ways to do this sort of think using
NSClient++. Precisely how you set it up depends a bit on how
obsessive you are about security and your particular preference.
The method shown above means you can have allow_arguments=0 and
allow_nasty_meta_chars=0 in the [nrpe] section which is good for
security. The downside is that if you need to change the warning
theshold, you have to edit the nsc.ini file on the target system.
hth,
Jim
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list