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

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -