Nagios émettteur de TRAP SNMP

3loO -  
 celine123 -
Bonjour,
Ma requête est simple...

Je souhaite faire émettre un trap SNMP de Nagios vers un autre Manager...

Est-ce que quelqu'un aurait éprouvé cette fonctionnalité avec Nagios ?
En utilisant Net-snmp et l'option Eventhandler et les MIB de Nagios qui permettraient de le faire...

Je vous remercie d'avance..

SE : Red Hat Linux 3
#uname -a
Linux ####### 2.4.21-4.ELsmp #1 SMP ################# 2003 i686 i686 i386 GNU/Linux
Nagios 2.10
NET-SNMP version: 5.0.8
Configuration: RED HAT
PowerEdge 1855

1 réponse

  1. cote-systeme
     
    nagios + nsca_client

    le fichier checkcommand
    contenant
    define command{
    command_name submit_host_check_result
    command_line $USER2$/submit_service_check_result $HOSTNAME$ $HOSTSTATE$ '$HOSTOUTPUT$'
    }

    dans le dossier eventhanlders
    le fichier submit_service_check_result
    contenant
    #!/bin/sh

    # Arguments:
    # $1 = host_name (Short name of host that the service is
    # associated with)
    # $2 = svc_description (Description of the service)
    # $3 = state_string (A string representing the status of
    # the given service - "OK", "WARNING", "CRITICAL"
    # or "UNKNOWN")
    # $4 = plugin_output (A text string that should be used
    # as the plugin output for the service checks)
    #

    # Convert the state string to the corresponding return code
    # modif david
    echo $4 > /usr/local/etc/nagios/eventhandlers/string

    sed "s/BR/<BR>/g" /usr/local/etc/nagios/eventhandlers/string > /usr/local/etc/nagios/eventhandlers/parser

    retour=$(cat /usr/local/etc/nagios/eventhandlers/parser)
    echo $retour
    #fin modif

    return_code=-1

    case "$3" in
    OK)
    return_code=0
    ;;
    WARNING)
    return_code=1
    ;;
    CRITICAL)
    return_code=2
    ;;
    UNKNOWN)
    return_code=-1
    ;;
    esac

    # pipe the service check info into the send_nsca program, which
    # in turn transmits the data to the nsca daemon on the central
    # monitoring server

    #/usr/bin/printf "%s\t%s\t%s\t%s\n" "$1" "$2" "$return_code" "$retour" | /usr/local/sbin/send_nsca IPnagios-c /usr/local/etc/nagios/send_nsca.cfg
    /usr/bin/printf "%s\t%s\t%s\t%s\n" "$1" "$2" "$return_code" "$retour" | /usr/local/sbin/send_nsca AutreIP -c /usr/local/etc/nagios/send_nsca.cfg
    0
    1. celine123
       
      Bonjour cote systeme,
      je voudrais récuperer les infos d'un serveur via NSCA (pour integrer a nagios) et superviser les ressources de ces serveurs comme (CPU, memoire,....)
      j'ai installée NSCA coté client et coté serveur ...et je sais pas comment je vais faire pour ke je puisse avancer.
      Merci d'avance cote systeme pour votre réponse.
      0