how to tell if there is VNC server run on remote Unix machine?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix administration > how to tell if there is VNC server run on remote Unix machine?




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    how to tell if there is VNC server run on remote Unix machine?  
walala


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:51 PM

thanks alot,

walala







[ Post a follow-up to this message ]



    Re: how to tell if there is VNC server run on remote Unix machine?  
Davide Bianchi


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:51 PM

walala <mizhael@yahoo.com> wrote:
quote:
> thanks alot,
The easy way is try to connect, the not-so-easy way is to use this script: #!/bin/bash MIB="1.3.6.1.2.1" PROCS=".25.4.2.1.2.1" DISKS=".25.2.3.1.3.1" INST=".25.6.3.1.2.1" if [ -z $1 ] ; then echo "Usage: $0 ipaddress [procs|disks|inst]" exit 0 fi if [ $2 == "inst" ] ; then NEXT=$INST END=".25.6.3.1.3.1" fi if [ $2 == "procs" ] ; then NEXT=$PROCS END=".25.4.2.1.3.1" fi if [ $2 == "disks" ] ; then DESC=".25.2.3.1.3." BLOCK=".25.2.3.1.4." TOTAL=".25.2.3.1.5." USED=".25.2.3.1.6." NEXT="1" END="25.2.3.1.4.1" while [ 1 ] ; do DSC=`snmpget $1 -v 1 -c public $MIB$DESC$NEXT | sed 's/.*STRING: \(.*\)$/\1/ '` if [ -z $DSC ] ; then echo "Error retriving data" exit 1 fi cat "$DSC" > /tmp/DSC.tmp OK=`grep -c 'Failed' /tmp/DSC.tmp` if [ $OK -gt 0 ] ; then echo "Error retriving data" exit 1 fi OK=`grep -c 'Timeout' /tmp/DSC.tmp` if [ $OK -gt 0 ] ; then echo "Error retriving data" exit 1 fi OK=`grep -c 'Error' /tmp/DSC.tmp` if [ $OK -gt 0 ] ; then echo "Error retriving data" exit 1 fi BLCK=`snmpget $1 -v 1 -c public $MIB$BLOCK$NEXT | sed 's/.*INTEGER: \(.*\)$/ \1/'` TOT=`snmpget $1 -v 1 -c public $MIB$TOTAL$NEXT | sed 's/.*INTEGER: \(.*\)$/\ 1/'` USD=`snmpget $1 -v 1 -c public $MIB$USED$NEXT | sed 's/.*INTEGER: \(.*\)$/\1 /'` COM=`snmpgetnext $1 -v 1 -c public $MIB$DESC$NEXT | sed "s/.*::mib-2.\([^ ]* \) =.*$/\1/"` BLCK=$((BLCK / 1024)) TOT=$((TOT * BLCK)) USD=$((USD * BLCK)) FREE=$((TOT - USD)) echo $DSC $TOT $USD $FREE if [ $COM == $END ] ; then exit 0 fi NEXT=$((NEXT+1)) done else while [ 1 ] ; do MB="$MIB$NEXT" RES=`snmpget $1 -v 1 -c public $MB | sed 's/.*STRING: "\(.*\)"$/\1/'` if [ -z "$RES" ] ; then echo "Error retriving data" exit 1 fi echo $RES NEXT=`snmpgetnext $1 -v 1 -c public $MB | sed "s/.*::mib-2\([^ ]*\) =.*$/\1/ "` if [ -z "$NEXT" ] ; then echo "Error retriving data" exit 1 fi if [ "$NEXT" = "$END" ] ; then exit fi done fi with the "procs" switch will tell you what's running on a remote Windows machine (if SNMP is enabled on the machine), you'll need snmpget on the machine. Davide




[ Post a follow-up to this message ]



    Re: how to tell if there is VNC server run on remote Unix machine?  
walala


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:51 PM


"Davide Bianchi" <davideyeahsure@onlyforfun.net> wrote in message
news:bn063k$rjgh5$4@ID-18487.news.uni-berlin.de...
quote:
> walala <mizhael@yahoo.com> wrote: > > The easy way is try to connect, the not-so-easy way is to use this script: > > #!/bin/bash > MIB="1.3.6.1.2.1" > PROCS=".25.4.2.1.2.1" > DISKS=".25.2.3.1.3.1" > INST=".25.6.3.1.2.1" > > if [ -z $1 ] ; then > echo "Usage: $0 ipaddress [procs|disks|inst]" > exit 0 > fi > > if [ $2 == "inst" ] ; then > NEXT=$INST > END=".25.6.3.1.3.1" > fi > > if [ $2 == "procs" ] ; then > NEXT=$PROCS > END=".25.4.2.1.3.1" > fi > > if [ $2 == "disks" ] ; then > DESC=".25.2.3.1.3." > BLOCK=".25.2.3.1.4." > TOTAL=".25.2.3.1.5." > USED=".25.2.3.1.6." > NEXT="1" > END="25.2.3.1.4.1" > while [ 1 ] ; do > > DSC=`snmpget $1 -v 1 -c public $MIB$DESC$NEXT | sed 's/.*STRING:
\(.*\)$/\1/'`
quote:
> if [ -z $DSC ] ; then > echo "Error retriving data" > exit 1 > fi > cat "$DSC" > /tmp/DSC.tmp > OK=`grep -c 'Failed' /tmp/DSC.tmp` > if [ $OK -gt 0 ] ; then > echo "Error retriving data" > exit 1 > fi > OK=`grep -c 'Timeout' /tmp/DSC.tmp` > if [ $OK -gt 0 ] ; then > echo "Error retriving data" > exit 1 > fi > OK=`grep -c 'Error' /tmp/DSC.tmp` > if [ $OK -gt 0 ] ; then > echo "Error retriving data" > exit 1 > fi > > BLCK=`snmpget $1 -v 1 -c public $MIB$BLOCK$NEXT | sed 's/.*INTEGER:
\(.*\)$/\1/'`
quote:
> TOT=`snmpget $1 -v 1 -c public $MIB$TOTAL$NEXT | sed 's/.*INTEGER:
\(.*\)$/\1/'`
quote:
> USD=`snmpget $1 -v 1 -c public $MIB$USED$NEXT | sed 's/.*INTEGER:
\(.*\)$/\1/'`
quote:
> COM=`snmpgetnext $1 -v 1 -c public $MIB$DESC$NEXT | sed
"s/.*::mib-2.\([^ ]*\) =.*$/\1/"`
quote:
> > BLCK=$((BLCK / 1024)) > TOT=$((TOT * BLCK)) > USD=$((USD * BLCK)) > FREE=$((TOT - USD)) > echo $DSC $TOT $USD $FREE > if [ $COM == $END ] ; then > exit 0 > fi > NEXT=$((NEXT+1)) > done > else > while [ 1 ] ; do > MB="$MIB$NEXT" > RES=`snmpget $1 -v 1 -c public $MB | sed 's/.*STRING: "\(.*\)"$/\1/'` > if [ -z "$RES" ] ; then > echo "Error retriving data" > exit 1 > fi > echo $RES > NEXT=`snmpgetnext $1 -v 1 -c public $MB | sed "s/.*::mib-2\([^ ]*\)
=.*$/\1/"`
quote:
> if [ -z "$NEXT" ] ; then > echo "Error retriving data" > exit 1 > fi > if [ "$NEXT" = "$END" ] ; then > exit > fi > done > fi > > with the "procs" switch will tell you what's running on a remote > Windows machine (if SNMP is enabled on the machine), you'll need > snmpget on the machine. > > Davide
Thanks a lot man! You are so great how did you make this script out? :=) -Walala




[ Post a follow-up to this message ]



    Re: how to tell if there is VNC server run on remote Unix machine?  
Davide Bianchi


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:51 PM

walala <mizhael@yahoo.com> wrote:
quote:
> Thanks a lot man! > You are so great how did you make this script out? :=)
Used getif on Windows to have the correct "class" numbers and then played along. You can also ask for everything, but it will take longer. Davide




[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:20 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register