Exemplo de programa que chama software gerente SNMP e inspeciona periodicamente objetos gerenciados selecionados

 
Programa em FORTRAN

c Inicio do loop principal do programa
       call system('date > tchepoa.log')
       call system('snmpi -a tchepoa.tche.br < entrada.tche >> tchepoa.log')
         call system('sleep 60')
       call system('snmpi -a tchepoa.tche.br < entrada.tche >> tchepoa.log')
       print *,'Terminou leitura das variaveis'
         stop
         end 

bulk system
bulk interfaces
bulk icmp
bulk ip
bulk tcp
bulk snmp
Resultado da execução do programa
tchepoa.log
Programa em C

#include <ucd-snmp/ucd-snmp-config.h>
#include <ucd-snmp/ucd-snmp-includes.h>

int main ()
{
        struct snmp_session session, *ss;
        struct snmp_pdu *pdu, *response;
        struct variable_list *vars;
        oid anOID[MAX_OID_LEN];
        size_t anOID_len = MAX_OID_LEN;
        int status;

        init_snmp ("teste");

        snmp_sess_init (&session);
        session.version = SNMP_VERSION_1;
        session.peername = "roteador.rede.dom.br";
        session.community = "xxxxxx";
        session.community_len = strlen (session.community);

        ss = snmp_open (&session);

        pdu = snmp_pdu_create (SNMP_MSG_GET);

        get_node ("sysDescr.0", anOID, &anOID_len);

        snmp_add_null_var (pdu, anOID, anOID_len);

        status = snmp_synch_response (ss, pdu, &response);

        if (status == STAT_SUCCESS && response->errstat == SNMP_ERR_NOERROR)
        {
                for (vars = response->variables;
                     vars != NULL;
                     vars = vars->next_variable)
                        if (vars->type == ASN_OCTET_STR)
                                printf ("%s\n", vars->val.string);
                        else
                                printf ("Não string\n");
        } else {
                if (status == STAT_SUCCESS)
                        printf ("Erro do processamento\n");
                else
                        printf ("Erro de comunicacao\n");
        }

        if (response) snmp_free_pdu (response);
        snmp_close (ss);
}