X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=ossec-hids.git;a=blobdiff_plain;f=debian%2Fossec-hids%2Fvar%2Fossec%2Fagentless%2Fssh_generic_diff;fp=debian%2Fossec-hids%2Fvar%2Fossec%2Fagentless%2Fssh_generic_diff;h=cc984ffa68f1a39185906d964f6e0b511a5f89ab;hp=0000000000000000000000000000000000000000;hb=3f728675941dc69d4e544d3a880a56240a6e394a;hpb=927951d1c1ad45ba9e7325f07d996154a91c911b diff --git a/debian/ossec-hids/var/ossec/agentless/ssh_generic_diff b/debian/ossec-hids/var/ossec/agentless/ssh_generic_diff new file mode 100755 index 0000000..cc984ff --- /dev/null +++ b/debian/ossec-hids/var/ossec/agentless/ssh_generic_diff @@ -0,0 +1,44 @@ +#!/usr/bin/env expect + +# Agentless monitoring +# +# Copyright (C) 2009 Trend Micro Inc. +# All rights reserved. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation. + +# Main script +source "agentless/main.exp" + +# SSH to the box and pass the directories to check +if [catch { + spawn ssh $hostname +} loc_error] { + send_user "ERROR: Opening connection: $loc_error.\n" + exit 1; +} + +source $sshsrc +source $susrc + +set timeout 600 +send_user "INFO: Starting.\n" +send_user "\nSTORE: now\n" +send "$args\r" +send "exit\r" + +expect { + timeout { + send_user "ERROR: Timeout while running commands on host: $hostname .\n" + exit 1; + } + eof { + send_user "\nINFO: Finished.\n" + exit 0; + } +} + +exit 0;