Client FOG - Server FOG
-
Hello,
Is it possible to send information from a linux client fog machine to the fog server.
I would like to extract the result of the command “last” in a file that will be sent to the fog server.
Thanks.
-
@Almeida Do I get this right? You want to run a command on one (or many) or your clients and get the output of that command back?!
I suppose you can use snapins if you have the fog-client installed on the linux machine. But snapins usually don’t return command output to the server. So you’d need to write a script that first mounts a share on your FOG server and pipes the output of
last
to a file on that network share.Do you have SSH enabled on the Linux client machines? If so I’d suggest using
clusterssh
to achieve what you want to do. -
We have implemented that on Linux and windows machines with the fog-client.
We have a little snapin’s collection to create and upload configuration templates/backups from some clients to a dedicated ftp server.
We have another little snapin’s collection to retrieve/modify information via webservices too.The secret is the recipe to the script code to be executed by fog-client.
My little experience (at this moment) is: if you can code it then fog can do it. (Sometimes can be so hard and sometimes you must not to do it.)
-
@EduardoTSeoane Do you mind sharing a simple script as basis to start from?
-
this is a simply example, security is by your side:
#!/bin/bash SERVER=$1 USERNAME=$2 PASSWORD=$3 FILE=$4 USER_TO_LAST=$5 echo "Result from last $USER_TO_LAST" &> $FILE last $USER_TO_LAST &>> $FILE lftp -u $USERNAME,$PASSWORD $SERVER << EOF put $FILE EOF
Configure as on image:
Snapin template is bash.
Tested on Linux Mint 19.