Utilisation de scli
Compilation de scli 0.2.12 sur Mac OS X 10.3.9 et suivants
Pour compiler scli-0.2.12 sur Mac OS X 10.3.9, il convient d'avoir au préalable installé les librairies suivantes :
- pkgconfig-0.16.0
- gettext-0.14.3
- glib-1.2.10
- libxml2-2.6.18
- readline-5.0
- libsmi-0.4.3
Commencons par pkgconfig-0.16.0:
$ cd pkgconfig-0.16.0
$ ./configure
$ make
$ sudo make install
Dans la fenetre de terminal qui va servir à la suite de la compilation, il convient de definir une variable d'environnement :
$ export PKG_CONFIG=/usr/local/bin/pkg-config
Au tour de gettext-0.14.3
$ cd gettext-0.14.3
$ ./configure
$ make
$ sudo make install
Dans la fenetre de terminal qui va servir à la suite de la compilation, il convient de definir une variable d'environnement :
$ export DYLD_LIBRARY_PATH=/usr/local/lib
Le projet utilise aussi la glib
$ cd glib-1.2.10
$ ./configure
$ make
$ sudo make install
$ cd glib-2.6.3
Virer le test sur gettext qui plante dans le fichier configure sur Mac OS 10.3
$ ./configure
$ make
$ sudo make install
Un grand classique pour gérer les fichier xml, libxml2-2.6.18
$ cd libxml2-2.6.18
$ ./configure
$ make
$ sudo make install
Pour améliorer la gestion de la ligne de commande, scli utilise readline-5.0
$ cd readline-5.0
$ ./configure
$ make
$ sudo make install
On arrive au bout du chemin, scli utilise libsmi-0.4.3 pour gérer les fichiers de MIB
$ cdlibsmi-0.4.3
$ ./configure
$ make
$ sudo make install
On est maintenant à même de compiler l'outil tant recherché scli-0.2.12
$ tar zxvf scli-0.2.12.tar.gz
$ cd scli-0.2.12
$ ./configure --with-glib-prefix=/usr/local --with-xml-prefix=/usr/local
$ make
$ sudo make install
$ cd /usr/local/bin/
$ ./scli
Utilisation typique de scli 0.2.12
Recherchons de l'aide sur les options de la ligne de commande
G5:/usr/local/bin philippe$
/usr/local/bin/scli -h
Usage: scli [OPTION] [hostname [community]]
Options:
-V, --version show version information
and exit
-c, --command process the given command
and exit
-d, --delay delay in seconds
between screen updates (default 5)
-f, --file process
commands from a file and exit
-h, --help display
this help and exit
-n, --norc do not
evaluate ~/.sclirc on startup
-p, --port port number
of the SNMP agent (default 161)
-r, --retries number of retries (default
3)
-s, --dry-run parse commands but do not
execute them
-t, --timeout timeout between retries in
milliseconds (default 500)
-v, --snmp version of
the SNMP protocol (1, 2c, 3)
-x, --xml
produce machine readable XML output
Recherchons de l'aide sur les options de l'interpreteur intégré à scli
G5:/usr/local/bin philippe$
/usr/local/bin/scli -v 1 192.168.42.253 public
100-scli version 0.2.12 (c) 2001-2002 Juergen Schoenwaelder
(192.168.42.253) scli > help
Scli is a command interpreter which can be used to browse,
monitor and configure SNMP enabled devices. All scli commands
are organized in a hierarchy. The top-level commands are:
- open Establish
an association to a remote SNMP agent.
- close Close the
association to a remote SNMP agent.
- exit Exit the
scli command interpreter.
- help Show this
help information.
- history Show the history of the
last scli commands.
- create Create object
instances on the remote SNMP agent.
- delete Delete object
instances from the remote SNMP agent.
- set
Modify object instances on the remote SNMP agent.
- show Show
information provided by the remote SNMP agent.
- monitor Monitor information
provided by the remote SNMP agent.
- dump Dump scli
command sequences to restore configurations.
Use the "show scli command tree" command to browse the complete
scli command tree and the "show scli modes" command to obtain
a detailed description of the various scli commands.
Pour afficher des informations snmp sur une machine (c'était bien le but recherché)
G5:/usr/local/bin philippe$
/usr/local/bin/scli -v 1 192.168.42.253 public
100-scli version 0.2.12 (c) 2001-2002 Juergen Schoenwaelder
(192.168.42.253) scli > show
500 noSuchName @ varbind 1
500 noSuchName @ varbind 1
# show system info [192.168.42.253] [2005-05-23 16:27:08 +02:00]
Name:
Switch 3300XM
Address:
192.168.42.253:161
Description: 3Com SuperStack 3
Contact: Philippe
Location: Le trou du monde
Vendor:
3Com <http://www.3com.com/>
Services: datalink
Agent Boot Time: 2004-09-22 12:38:00 +02:00
Interfaces: 46
Bridge Ports: 24
Bridge Type: transparent (TP)
# show ip info [192.168.42.253] [2005-05-23 16:27:10 +02:00]
Forwarding: enabled
Default TTL: 255 hops
Reasm Timeout: 5 seconds
# show ip forwarding [192.168.42.253] [2005-05-23 16:27:11 +02:00]
DESTINATION TOS
NEXT-HOP
TYPE PROTO
INTERFACE
0.0.0.0/25
- 161.71.15.1 indirect
local 0
192.168.42.0/24 -
192.168.42.253 direct
local 141 ()
192.168.101.0/24 -
192.168.101.1 direct
local 140 ()
192.168.101.2/32 -
192.168.101.1 direct
local 140 ()
... des tonnes d'informations utiles aux administrateur réseaux (essayez vous même ;-))
(192.168.42.253) scli > exit