[Nagios-users] Windows Active Sessions

2012-01-23 Thread Robert Jackson
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.





Regards,

Rab.

=

Robert Jackson  Phone: +44 (0) 141 332
7999

IT Manager   Fax: +44 (0) 141
331 2820

Walker Martyn Ltd

1 Park Circus PlaceEmail:
r...@walkermartyn.co.uk mailto:r...@walkermartyn.co.uk

Glasgow G3 6AH, Scotland   Web:
http://www.walkermartyn.co.uk http://www.walkermartyn.co.uk/

=







The information in this internet E-mail is confidential and is intended
solely for the addressee. Access, copying or re-use of information in it
by anyone else is unauthorised. Any views or opinions presented are
solely those of the author and do not necessarily represent those of
Walker Martyn Ltd or any of its affiliates. If you are not the
intended recipient please contact  administra...@walkermartyn.co.uk

Walker Martyn Ltd, company number SC197533. Company is
registered in Scotland and has its registered office at 1 Park
Circus Place, Glasgow G3 6AH, UK.




--
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@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

Re: [Nagios-users] Windows Active Sessions

2012-01-23 Thread Jim Avery
On 23 January 2012 13:09, Robert Jackson r...@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_namecheck_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_groupsnotify-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@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


Re: [Nagios-users] Windows Active Sessions

2012-01-23 Thread Robert Jackson
Hi Jim,

Many thanks for the excellent reply. I'll give it a bash and see if I
can get it going.

-Original Message-
From: Jim Avery [mailto:j...@jimavery.me.uk] 
Sent: Monday 23 January 2012 13:43
To: Nagios Users List
Subject: r...@walkermartyn.co.uk - Re: [Nagios-users] Windows Active
Sessions - Bayesian Filter detected spam

On 23 January 2012 13:09, Robert Jackson r...@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_namecheck_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_groupsnotify-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@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




The information in this internet E-mail is confidential and is intended
solely for the addressee. Access, copying or re-use of information in it
by anyone else is unauthorised. Any views or opinions presented are
solely those of the author and do not necessarily represent those of
Walker Martyn Ltd or any of its affiliates. If you are not the
intended recipient please contact  administra...@walkermartyn.co.uk

Walker Martyn Ltd, company number SC197533. Company is 
registered in Scotland and has its registered office at 1 Park
Circus Place, Glasgow G3 6AH, UK.





--
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@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


Re: [Nagios-users] Windows Active Sessions

2012-01-23 Thread Claudio Kuenzler
There's also an existing plugin for this: check_user_count.bat
http://exchange.nagios.org/directory/Plugins/Remote-Access/Count-number-of-terminal-server-sessions/details

However I suggest to use checkCounter, as Jim Avery mentioned it. That way
you keep independent of additional files.

On Mon, Jan 23, 2012 at 2:54 PM, Robert Jackson r...@walkermartyn.co.ukwrote:

 Hi Jim,

 Many thanks for the excellent reply. I'll give it a bash and see if I
 can get it going.

 -Original Message-
 From: Jim Avery [mailto:j...@jimavery.me.uk]
 Sent: Monday 23 January 2012 13:43
 To: Nagios Users List
 Subject: r...@walkermartyn.co.uk - Re: [Nagios-users] Windows Active
 Sessions - Bayesian Filter detected spam

 On 23 January 2012 13:09, Robert Jackson r...@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_namecheck_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_groupsnotify-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@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



 
 The information in this internet E-mail is confidential and is intended
 solely for the addressee. Access, copying or re-use of information in it
 by anyone else is unauthorised. Any views or opinions presented are
 solely those of the author and do not necessarily represent those of
 Walker Martyn Ltd or any of its affiliates. If you are not the
 intended recipient please contact  administra...@walkermartyn.co.uk

 Walker Martyn Ltd, company number SC197533. Company is
 registered in Scotland and has its registered office at 1 Park
 Circus Place, Glasgow G3 6AH, UK.
 





 --
 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@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

--
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

Re: [Nagios-users] Windows Active Sessions

2012-01-23 Thread Robert Jackson
Hi Jim,

Managed to get some output, but not what I expected:

I (0.3.8.75 2010-05-27) seem to be doing fine

I get the same manually running check_nrpe from the Nagios host command
line.


Any ideas?

-Original Message-
From: Jim Avery [mailto:j...@jimavery.me.uk] 
Sent: Monday 23 January 2012 13:43
To: Nagios Users List
Subject: r...@walkermartyn.co.uk - Re: [Nagios-users] Windows Active
Sessions - Bayesian Filter detected spam

On 23 January 2012 13:09, Robert Jackson r...@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_namecheck_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_groupsnotify-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@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




The information in this internet E-mail is confidential and is intended
solely for the addressee. Access, copying or re-use of information in it
by anyone else is unauthorised. Any views or opinions presented are
solely those of the author and do not necessarily represent those of
Walker Martyn Ltd or any of its affiliates. If you are not the
intended recipient please contact  administra...@walkermartyn.co.uk

Walker Martyn Ltd, company number SC197533. Company is 
registered in Scotland and has its registered office at 1 Park
Circus Place, Glasgow G3 6AH, UK.





--
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@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


Re: [Nagios-users] Windows Active Sessions

2012-01-23 Thread Jim Avery
On 23 January 2012 14:56, Robert Jackson r...@walkermartyn.co.uk wrote:
 Hi Jim,

 Managed to get some output, but not what I expected:

 I (0.3.8.75 2010-05-27) seem to be doing fine

 I get the same manually running check_nrpe from the Nagios host command
 line.


 Any ideas?

I've not seen that myself, but a quick google for nsclient++ seem to
be doing fine comes up with this.

http://www.nsclient.org/nscp/discussion/topic/510

I think that's very likely your solution.

--
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@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