• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Client FOG - Server FOG

    Scheduled Pinned Locked Moved
    General
    3
    5
    416
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      Almeida
      last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • S
        Sebastian Roth Moderator
        last edited by

        @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.

        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

        1 Reply Last reply Reply Quote 0
        • EduardoTSeoaneE
          EduardoTSeoane
          last edited by

          @Almeida

          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.)

          1 Reply Last reply Reply Quote 0
          • S
            Sebastian Roth Moderator
            last edited by

            @EduardoTSeoane Do you mind sharing a simple script as basis to start from?

            Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

            Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

            1 Reply Last reply Reply Quote 0
            • EduardoTSeoaneE
              EduardoTSeoane
              last edited by

              @Almeida
              @Sebastian-Roth

              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.
              example.png

              Tested on Linux Mint 19.

              1 Reply Last reply Reply Quote 1
              • 1 / 1
              • First post
                Last post

              237

              Online

              12.0k

              Users

              17.3k

              Topics

              155.2k

              Posts
              Copyright © 2012-2024 FOG Project