Datto RMM- Agent Installation Scripts for Linux
CyberCNS Lightweight Agent Installation Script for Linux
Please use your CyberCNS Domain/Tenant name in the CyberCNS Agent download link mentioned in the script as shown below:
e.g. cybercnstenant value should be learn for CyberCNS Domain/tenant learn.
The script for CyberCNS V3:Linux
Note: The script for new infrastructure: ( this script has changed the agent download URL which is suitable for new infrastructure)
The Script used for CyberCNS V2:
#!/bin/bash
# checking whether the user is a root or normal user
function check_root {
if [[ "x$(id -u)" != 'x0' ]]; then
echo 'Error: this script can only be executed by the root'
exit 1
fi
}
# checking whether the agent already exists if not will install the agent
function install_lightweight {
if [ -z "$cybercnscompanyid" ]
then
echo "\$cybercnscompanyid is NULL"
exit 1
fi
if [ -z "$cybercnsclientid" ]
then
echo "\$cybercnsclientid is NULL"
exit 1
fi
if [ -z "$cybercnsclientsecret" ]
then
echo "\$cybercnsclientsecret is NULL"
exit 1
fi
if [ -z "$cybercnsdomain" ]
then
echo "\$cybercnsdomain is NULL"
exit 1
fi
pgrep cybercnsagentv2
exitcode=$?
if [ $exitcode -eq 0 ]; then
echo "lightweight agent already running in the machine"
else
echo "Downloading http://<domain>.mycybercns.com/agents/ccnsagent/cybercnsagent_linux"
exitcode=$(curl --write-out %{http_code} -L -g "http://<domain>.mycybercns.com/agents/ccnsagent/cybercnsagent_linux" -s -o cybercnsagent_linux)
if [ $exitcode -ne 200 ]; then
if [ "$exitcode" == "000" ]; then
exitcode=-1
fi
echo "Was not able to fetch the lightweight cybercnsagent agent for ubuntu"
exit $exitcode
fi
chmod +x cybercnsagent_linux;
sudo ./cybercnsagent_linux -c $cybercnscompanyid -a $cybercnsclientid -s $cybercnsclientsecret -b $cybercnsdomain -i LightWeight
fi
}
function install {
check_root
install_lightweight
}
install
CyberCNS Probe Agent Installation Script for Linux
Note: The script for new infrastructure: ( this script has changed the agent download URL which is suitable for new infrastructure)
The Script used for CyberCNS V3:
The Script used for CyberCNS V2:
#!/bin/bash
# checking whether the user is roota or a normal user
function check_root {
if [[ "x$(id -u)" != 'x0' ]]; then
echo 'Error: this script can only be executed by the root'
exit 1
fi
}
# checking whether the agent already exists if not will install the agent
function install_lightweight {
if [ -z "$cybercnscompanyid" ]
then
echo "\$cybercnscompanyid is NULL"
exit 1
fi
if [ -z "$cybercnsclientid" ]
then
echo "\$cybercnsclientid is NULL"
exit 1
fi
if [ -z "$cybercnsclientsecret" ]
then
echo "\$cybercnsclientsecret is NULL"
exit 1
fi
if [ -z "$cybercnsdomain" ]
then
echo "\$cybercnsdomain is NULL"
exit 1
fi
pgrep cybercnsagentv2
exitcode=$?
if [ $exitcode -eq 0 ]; then
echo "Probe agent already running in the machine"
else
echo "Downloading http://<domain>.mycybercns.com/agents/ccnsagent/cybercnsagent_linux"
exitcode=$(curl --write-out %{http_code} -L -g "http://<domain>.mycybercns.com/agents/ccnsagent/cybercnsagent_linux" -s -o cybercnsagent_linux)
if [ $exitcode -ne 200 ]; then
if [ "$exitcode" == "000" ]; then
exitcode=-1
fi
echo "Was not able to fetch the Probe cybercnsagent agent for ubuntu"
exit $exitcode
fi
chmod +x cybercnsagent_linux;
sudo ./cybercnsagent_linux -c $cybercnscompanyid -a $cybercnsclientid -s $cybercnsclientsecret -b $cybercnsdomain -i Probe
fi
}
function install {
check_root
install_probe
}
install