Thanks for your answers.<div><br></div><div>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.</div><div><br></div><div>About <span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); ">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 =)</span></div>
<div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); "><br></span></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); "><br>
</span></div><div><br><div class="gmail_quote">2011/10/6 Schimpke, Dr. Thomas - bhn <span dir="ltr"><<a href="mailto:Schimpke.Thomas@bhn-services.com">Schimpke.Thomas@bhn-services.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
<br>
what about HOST-RESOURCES-MIB::hrSystemNumUsers.0 ?<br>
<br>
snmpget -v2c -c xxx belinda HOST-RESOURCES-MIB::hrSystemNumUsers.0<br>
HOST-RESOURCES-MIB::hrSystemNumUsers.0 = Gauge32: 2<br>
<br>
You have to load the MIB of cause. If you prefer the numerical OID:<br>
<br>
snmptranslate -On HOST-RESOURCES-MIB::hrSystemNumUsers.0<br>
..<a href="tel:1.3.6.1.2.1.25.1.5.0" value="+13612125150">1.3.6.1.2.1.25.1.5.0</a><br>
<font color="#888888"><br>
Thomas<br>
</font><div><div></div><div class="h5"><br>
On 10/06/2011 01:25 PM, Marc-André Doll wrote:<br>
> Hi,<br>
><br>
> I don't know about some SNMP OID which lists the connected users on<br>
> Linux servers (and if someone knows about it, I will be glad to be<br>
> updated). You can however interface your script with the UCD MIB on your<br>
> monitored servers using the extTable table <a href="tel:%281.3.6.1.4.1.2021.8" value="+13614120218">(1.3.6.1.4.1.2021.8</a>).<br>
><br>
> Marc-André<br>
><br>
> On Thu, 2011-10-06 at 12:54 +0200, Anthony BRODARD wrote:<br>
>> Hi list,<br>
>><br>
>><br>
>> I would to detect if any user is directly connected (console) on my<br>
>> Linux servers (Debian, CentOS).<br>
>> I've created this bash simply bash script :<br>
>><br>
>><br>
>> #!/bin/bash<br>
>><br>
>><br>
>> WHO=`which who`<br>
>> GREP=`which grep`<br>
>> WC=`which wc`<br>
>><br>
>><br>
>> RESULT=`$WHO | $GREP tty | $WC -l`<br>
>><br>
>><br>
>> if [ $RESULT -ne 0 ]<br>
>> then<br>
>> echo $RESULT "utilisateur(s) connecte(s) en console"<br>
>> exit 1<br>
>> else<br>
>> echo "OK"<br>
>> exit 0<br>
>> fi<br>
>><br>
>><br>
>> It works fine, but I prefer to use an other method, most lighter than<br>
>> the check_by_ssh.<br>
>> Do you know an other way to do that, via SNMP for exemple.<br>
>><br>
>><br>
>> Regards<br>
>> ------------------------------------------------------------------------------<br>
>> All the data continuously generated in your IT infrastructure contains a<br>
>> definitive record of customers, application performance, security<br>
>> threats, fraudulent activity and more. Splunk takes this data and makes<br>
>> sense of it. Business sense. IT sense. Common sense.<br>
>> <a href="http://p.sf.net/sfu/splunk-d2dcopy1" target="_blank">http://p.sf.net/sfu/splunk-d2dcopy1</a><br>
>> _______________________________________________ Nagios-users mailing list <a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a> <a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null<br>
><br>
><br>
> ------------------------------------------------------------------------------<br>
> All the data continuously generated in your IT infrastructure contains a<br>
> definitive record of customers, application performance, security<br>
> threats, fraudulent activity and more. Splunk takes this data and makes<br>
> sense of it. Business sense. IT sense. Common sense.<br>
> <a href="http://p.sf.net/sfu/splunk-d2dcopy1" target="_blank">http://p.sf.net/sfu/splunk-d2dcopy1</a><br>
> _______________________________________________<br>
> Nagios-users mailing list<br>
> <a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>
> <a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<br>
> ::: Messages without supporting info will risk being sent to /dev/null<br>
------------------------------------------------------------------------------<br>
All the data continuously generated in your IT infrastructure contains a<br>
definitive record of customers, application performance, security<br>
threats, fraudulent activity and more. Splunk takes this data and makes<br>
sense of it. Business sense. IT sense. Common sense.<br>
<a href="http://p.sf.net/sfu/splunk-d2dcopy1" target="_blank">http://p.sf.net/sfu/splunk-d2dcopy1</a><br>
_______________________________________________<br>
Nagios-users mailing list<br>
<a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<br>
::: Messages without supporting info will risk being sent to /dev/null</div></div></blockquote></div><br></div>