ssh - Expect regexp telnet -
i newcomer not having great experience expect commands. have monitor linux servers on not have right install ssh keys, snmp agent , other nrpe.
i created or rather resumed script expect:
#! / usr / bin / expect -f set force_conservative 1; set timeout 6 set env (term) spawn ssh root @ myip expect "password: $" send "mypassword \ r" #set var 0 expect "$" send "ps -ef |grep apache\ r" sleep 5 send "exit \ r" expect eof #interact
in script, send test command checks on remote server whether "apache" process running.
how result of command on nagios server notified mail?
thank helping me.
Comments
Post a Comment