Check

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


Thanks for your answers.

I don't know how works the OID 1.3.6.1.4.1.2201.8. I will search more
information about it. Thanks for this solution.

About HOST-RESOURCES-MIB::hrSystemNumUsers.0, it returns number of opened
sessions, include ssh. I just want to see if a session is opened in a tty.
But thanks too for your help =)



2011/10/6 Schimpke, Dr. Thomas - bhn <Schimpke.Thomas at bhn-services.com>

> Hi,
>
> what about HOST-RESOURCES-MIB::hrSystemNumUsers.0 ?
>
> snmpget -v2c -c xxx  belinda HOST-RESOURCES-MIB::hrSystemNumUsers.0
> HOST-RESOURCES-MIB::hrSystemNumUsers.0 = Gauge32: 2
>
> You have to load the MIB of cause. If you prefer the numerical OID:
>
> snmptranslate -On HOST-RESOURCES-MIB::hrSystemNumUsers.0
> ..1.3.6.1.2.1.25.1.5.0
>
> Thomas
>
> On 10/06/2011 01:25 PM, Marc-André Doll wrote:
> > Hi,
> >
> > I don't know about some SNMP OID which lists the connected users on
> > Linux servers (and if someone knows about it, I will be glad to be
> > updated). You can however interface your script with the UCD MIB on your
> > monitored servers using the extTable table (1.3.6.1.4.1.2021.8).
> >
> > Marc-André
> >
> > On Thu, 2011-10-06 at 12:54 +0200, Anthony BRODARD wrote:
> >> 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
> >>
> ------------------------------------------------------------------------------
> >> 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
> >> _______________________________________________ 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
> >
> >
> >
> ------------------------------------------------------------------------------
> > 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
> > _______________________________________________
> > 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
>
> ------------------------------------------------------------------------------
> 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
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20111006/53d6c454/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