Package: gsuite-sync
GSuite_SyncSync MAC addresses from your GSuite into Cisco ISEINSTALL PROCESSTo set up gsync as a service on Linux, follow the below processPrep the Linux OS with Python3Install required OS packages for PythonRaspberry Pimay need Python and PIPsudo apt install -y python-pipas well assudo apt-get install libffi-devDebian (Ubuntu)distributions may need Python and PIPInstall Python and PIP:sudo apt install -y python-pipRHEL (CentOS)distributions usually need PIPInstall the EPEL package:sudo yum install -y epel-releaseInstall PIP:sudo yum install -y python36-pipBack up the old Python2 binary:mv /usr/bin/python /usr/bin/python-oldMake Python3 the default binary:sudo ln -fs /usr/bin/python36 /usr/bin/pythonInstall GSync from PyPiInstall using PIP:pip install gsuite_syncInstall GSync from sourceRetrieve the source code repository using one of the two below methodsMethod #1: Install a Git client (process differs depending on OS) and clone the GSuite_Sync repository using Gitgit clone https://github.com/PackeTsar/gsuite_sync.gitChange to the branch you want to install usinggit checkout <branch_name>Method #2: Download and extract the repository files from theGithub RepoMake sure to download the branch you want to installMove into the gsuite_sync project directorycd gsuite_syncRun the setup.py file to build the package into the ./build/ directorypython setup.py buildUse PIP to install the packagepip install .Once the install completes, you should be able to run the commandgsync -hand see the help menu. GSync is now ready to use.Help Outputusage: gsync [-h] [-v] [-gc CREDENTIAL_FILE] [-gm REGEX] [-ia IP/ADDRESS]
             [-iu USERNAME] [-ip PASSWORD] [-ig GROUP_NAME] [-c CONFIG_FILE]
             [-l LOG_FILE] [-d] [-fs] [-um MAC_ADDRESS] [-us SERIAL_NUMBER]
             [-m]

GSuite_Sync - Sync Chromebook MAC addresses from your GSuite into Cisco ISE

Misc Arguments:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit

Required Arguments:
  -gc CREDENTIAL_FILE, --gsuite_credential CREDENTIAL_FILE
                        GSuite Credential File
  -ia IP/ADDRESS, --ise_address IP/ADDRESS
                        ISE DNS or IP Address
  -iu USERNAME, --ise_username USERNAME
                        ISE Login Username
  -ip PASSWORD, --ise_password PASSWORD
                        ISE Login Password
  -ig GROUP_NAME, --ise_group GROUP_NAME
                        ISE Target Endpoint Group

Optional Arguments:
  -gm REGEX, --gsuite_path_match REGEX
                        GSuite Object Path Match Pattern
  -c CONFIG_FILE, --config_file CONFIG_FILE
                        Config File Path
  -l LOG_FILE, --logfiles LOG_FILE
                        Log File Path
  -d, --debug           Set debug level (WARNING by default)
                                Debug level INFO:  '-d'
                                Debug level DEBUG: '-d'

Action Arguments:
  -fs, --full_sync      Perform full sync of GSuite MACs to ISE Group
  -um MAC_ADDRESS, --update_mac MAC_ADDRESS
                        Push an individual MAC to the ISE Group
  -us SERIAL_NUMBER, --update_serial SERIAL_NUMBER
                        Lookup a device's MAC and update it in the ISE Group
  -m, --maintain        maintain pushing devicesExample Config FilesArguments can be passed in at the command line or with a config file. It is often easier to use a config file and that is what we will do for setting up the service. The/root/credentials.jsonfile referenced is an API credential file for your GSuite account.Example Config File (/root/config.json){"gsuite_credential":"/root/credentials.json","gsuite_path_match":"SOMEREGEXPATHMATCH","ise_address":"192.168.1.100","ise_username":"admin","ise_password":"admin123","ise_group":"my_special_group","logfiles":["/etc/gsync/logs.log"]}Create the Service FileUse VI to create a new file (vi /etc/init.d/gsync) and insert the below BASH script for the file contents#!/bin/bash# gsync daemon# chkconfig: 345 20 80# description: gsync Daemon# processname: gsyncDAEMON_PATH="/usr/local/bin/"DAEMON=gsyncSTDOUTFILE=/etc/gsync/stdout.logSTDERR=/etc/gsync/stderr.logNAME=gsyncDESC="gsync Daemon"PIDFILE=/var/run/$NAME.pidSCRIPTNAME=/etc/init.d/$NAMEcase"$1"instart)printf"%-50s""Starting$NAME..."cd$DAEMON_PATHPID=`stdbuf-o0$DAEMON-c/root/config.json-m>>$STDOUTFILE2>>$STDERR&echo$!`#echo "Saving PID" $PID " to " $PIDFILEif[-z$PID];thenprintf"%s""Fail"elseecho$PID>$PIDFILEprintf"%s""Ok"fi;;status)if[-f$PIDFILE];thenPID=`cat$PIDFILE`if[-z"`ps axf | grep${PID}| grep -v grep`"];thenprintf"%s""Process dead but pidfile exists"elseecho"$DAEMON(pid$PID) is running..."fielseprintf"%s""$DAEMONis stopped"fi;;stop)printf"%-50s""Stopping$NAME"PID=`cat$PIDFILE`cd$DAEMON_PATHif[-f$PIDFILE];thenkill-HUP$PIDprintf"%s""Ok"rm-f$PIDFILEelseprintf"%s""pidfile not found"fi;;restart)$0stop$0start;;*)echo"Usage:$0{status|start|stop|restart}"exit1esacFinish and Start Up Servicechmod 777 /etc/init.d/gsync
chkconfig gsync on
service gsync start
service gsync status