Merci Jean-philippe
En fait j'avais bien compris c'est juste que je n'etais pas famillier avec la facon de l'utiliser

Donc ca fonctionne
voici le resultat
j'ai integré un petit code dans nagios/plugins
vi check_open_ports
- Code: Tout sélectionner
#vi check_open_ports
#!/bin/sh
##################################################################
# Last Modification:
# This script is verifing a closed port on a remote device
# if it's close, it will send OK to Nagios.
##################################################################
STATE_OK=0
STATE_WARNING=2
STATE_CRITICAL=1
STATE_UNKNOWN=4
STATE_DEPENDENT=5
STATE=$?
if [ "$STATE" = "$STATE_OK" ]
then
echo "TESTD OK"
exit 0
else
echo "TESTD Failed"
exit $STATE_CRITICAL
fi
puis on modify les droits et access
chown nagios:eyesofnetwork check_open_ports
chmod 775 check_open_ports
Ensuite j'ai crée une commande dans lilac/general/nagios command
name :check_telnet_closed
comand line:
$USER1$/negate $USER1$/check_tcp -H $HOSTADDRESS$ -p 23 $USER1$/check_open_ports echo $?
Ensuite j'ai créé une command intégrand les commandes.
Lilac/template/CISCO-IOS
ajouté un nouveau service inheritance à GENERIC_SERVICES
selectionné la commande check_telnet_closed
voici le resumé du service
Included in Definition:
Check Command: check_telnet_closed
Maximum Check Attempts: 1
Normal Check Interval: 1440
Retry Interval: 15
Active Checks: Enabled
Passive Checks: Disabled - Inherited From GENERIC_SERVICES
Check Period: 24x7
Parallize Checks: Enabled - Inherited From GENERIC_SERVICES
Obsess Over Service: Disabled - Inherited From GENERIC_SERVICES
Check Freshness: Disabled - Inherited From GENERIC_SERVICES
Freshness Threshold: 0 - Inherited From GENERIC_SERVICES
Event Handler: Enabled - Inherited From GENERIC_SERVICES
Event Handler Command: Notify-by-email-Service
J'ai re-utilisais en modifiant juste le port pour verifier 443 (https) et 80 http
ceci verifiant que seul SSH est authorisé
voici le resultat

Merci
Il me reste a trouver le nombre de connexion ouverte (dummy) sur les session vty afin de pouvoir les supprimer avant qu'elles atteingne le nombre maximum.
Si qq a une idée je suis preneur.