logo.png

Mib Snmp

LibSnmp

Grammaire

Intégration

Home Up


Contents



1 Introduction

Cette page décrits les modifications apportées au code source de BIG.


2 Bibliothèque SNMP

  • répertoire  /SBig/Server/include/net-snmp
  • fichier  /SBig/misc/libnetsnmp.so note : fichier binaire


3 Utilitaire WIENER

  • fichier  /SBig/Server/Bigd/include/Wiener.h
  • fichier  /SBig/Server/Bigd/Util/Wiener.c


4 Analyseur Grammatical

  • fichier  /SBig/Server/Bigd/Big/WIENERControl.c
  • fichier  /SBig/Server/include/Control.h
    ...
    extern int  WIENERControl(char *);
    ...
    
  • fichier  /SBig/Server/Bigd/Big/Big.c
    ...
    if (!Look4Key(local_buffer,"WIENER",  6) && !(val = WIENERControl  (local_buffer+7))) return(NOERR);
    ...
    
  • fichier  /SBig/Server/Bigd/Makefile
    ...
    LIBS   += -L../lib -lm -lpthread -lnetsnmp
    ...
    $(PROGRAM):     $(wildcard Object/*.o)
                    @echo -ne "Linking \t\033[1;31m$(PROGRAM)\033[0;39m ... \t "
                    @[ -f ../lib/libnetsnmp.so ] || ln -s ../../misc/libnetsnmp.so ../lib/.
                    ...
    
  • fichier  /SBig/Server/Client/WIENER_ON
    BEGIN 
    WIENER ON
    ENDMSG
    
  • fichier  /SBig/Server/Client/WIENER_OFF
    BEGIN 
    WIENER OFF
    ENDMSG
    


5 Test

  • Compilation
    $ cd ~/SBig/Server/Bigd
    $ make
    

  • Lancement du serveur
    $ telnet 192.168.1.162
    $ ~roche/SBig/Server/Bigd/big
    

  • Allumer/éteindre l'alim 192.168.1.86
    $ snmpwalk -v 2c -c public -On 192.168.1.86 .1.3.6.1.4.1.19947.1.1.1.0
    .1.3.6.1.4.1.19947.1.1.1.0 = INTEGER: 0
    
    $ telnet 192.168.1.162 1805
    BEGIN POWER ON
    ENDMSG
    
    $ snmpwalk -v 2c -c public -On 192.168.1.86 .1.3.6.1.4.1.19947.1.1.1.0
    .1.3.6.1.4.1.19947.1.1.1.0 = INTEGER: 1
    
    $ cat WIENER_ON | ~/SBig/Server/Client/client 192.168.1.162 1805
    
    $ snmpwalk -v 2c -c public -On 192.168.1.86 .1.3.6.1.4.1.19947.1.1.1.0
    .1.3.6.1.4.1.19947.1.1.1.0 = INTEGER: 0
    

Home Up

This document is also available in PDF and PostScript format.



2016-02-15