Check

Anthony BRODARD brodard.anthony at gmail.com
Thu Oct 6 12:54:12 CEST 2011


Hi list,

I would to detect if any user is directly connected (console) on my Linux
servers (Debian, CentOS).
I've created this bash simply bash script :

#!/bin/bash

WHO=`which who`
GREP=`which grep`
WC=`which wc`

RESULT=`$WHO | $GREP tty | $WC -l`

if [ $RESULT -ne 0 ]
then
  echo $RESULT "utilisateur(s) connecte(s) en console"
  exit 1
else
  echo "OK"
  exit 0
fi

It works fine, but I prefer to use an other method, most lighter than the
check_by_ssh.
Do you know an other way to do that, via SNMP for exemple.

Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20111006/27f5f721/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
-------------- next part --------------
_______________________________________________
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