I need to check some configurations in several servers located all over the net. I was thinking to use perl, nahhh... better to use shell script with ssh using sshkey.
#!/bin/bash
for in x `grep ^ iplist` do; ssh admin@"$x" "cat /etc/snort.config; mysql -uusername -ppassword snortdb -e "select * from events where event_id =9"; >> $x.result; done
Thats it.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment