Deploying Samanage Software on macs

EliasG
Contributor

Has anyone had any success deploying samanage software. They gave me this script but I am having no luck.

#!/bin/sh

# Uninstall current SAManage agent
/Applications/Samanage Agent.app/Contents/Resources/uninstaller.sh

# Change working directory to /tmp
cd /tmp

# Download SAManage Mac agent software
curl -O http://cdn.samanage.com/download/Mac+Agent/SAManage-Agent-for-Mac.dmg

# Mount the SAManage-Agent-for-Mac.dmg disk image as /tmp/SAManage-Mac-Agent
hdiutil attach SAManage-Agent-for-Mac.dmg -nobrowse -noverify -noautoopen

################################################################################
#
# Replace <ACCT_NAME> with your Samanage account name below
#
echo "<ACCT_NAME>" > /tmp/samanage
#
# Remove the '#' from the next line if you do not wish the Samanage agent to collect software information
# echo "nosoft=1" > /tmp/samanage_no_soft
#
################################################################################

# Install the SAManage Mac agent
installer -dumplog -verbose -pkg /Volumes/Samanage-Mac-Agent-*/Samanage-Mac-Agent-*.pkg -target "/"

# Clean-up
# Unmount the SAManage-Agent-for-Mac.dmg disk image from /Volumes
hdiutil eject -force /Volumes/Samanage-Mac-Agent-*

# Remove /tmp/samanage
rm /tmp/samanage

if [ -f  /tmp/samanage_no_soft ]; then
  rm /tmp/samanage_no_soft
fi

# Remove the SAManage-Agent-for-Mac.dmg disk image from /tmp
rm /tmp/SAManage-Agent-for-Mac.dmg

exit 0

and these are the directions

Download http://cdn.samanage.com/download/Mac+Agent/MAC-Agent-silent-install.sh
Save it to /tmp or in a network shared directory
Edit the script to include your account tag
Make it executable by running

chmod +x /tmp/MAC-Agent-silent-install.sh

Run the script as root, or use sudo

sudo /tmp/MAC-Agent-silent-install.sh

any help would be great thanks

3 ACCEPTED SOLUTIONS

thoule
Valued Contributor II

I don't see a problem with the script offhand. But it's very hard to read. Please edit your post, select the script and click the >_ icon. That'll format it so we can read it. Also, please tell us the error message you are getting when you run the script. You might also watch /var/log/install.log for errors.

View solution in original post

rtrouton
Release Candidate Programs Tester

Ha! That script looks familiar, I helped them write it a few years ago when my shop was evaluating SAManage:

https://github.com/rtrouton/rtrouton_scripts/tree/master/rtrouton_scripts/samanage_agent_silent_inst...

View solution in original post

EliasG
Contributor

I got it to work thanks guys. It was a stupid mistake on my end.

View solution in original post

9 REPLIES 9

thoule
Valued Contributor II

I don't see a problem with the script offhand. But it's very hard to read. Please edit your post, select the script and click the >_ icon. That'll format it so we can read it. Also, please tell us the error message you are getting when you run the script. You might also watch /var/log/install.log for errors.

rtrouton
Release Candidate Programs Tester

Ha! That script looks familiar, I helped them write it a few years ago when my shop was evaluating SAManage:

https://github.com/rtrouton/rtrouton_scripts/tree/master/rtrouton_scripts/samanage_agent_silent_inst...

EliasG
Contributor

I got it to work thanks guys. It was a stupid mistake on my end.

mpermann
Valued Contributor II

@EliasG what have you tried and where are you running into problems? One way to accomplish this would be to copy the script to /tmp and make the requested modifications to the script and then package that script up with Composer and create a post install script that runs the script. I haven't personally tried it but it seems like that should work.

dbriseno
New Contributor

@EliasG what was the fix? I can't get it to work

pmcgurn
New Contributor III

Looks like Samanage released a new agent, and the URL in this script wasn't/isn't updated to get that new agent version. The one it had deployed in the past is version 3.9, and now Samanage is using version 1.1.56.

Looks like we'll have to re-work this one...

EliasG
Contributor

Does anyone have a script to uninstall the old one? Or will the new one over ride it?

werddrew
New Contributor

Looks like the file is back to the location specified:

http://cdn.samanage.com/download/Mac+Agent/SAManage-Agent-for-Mac.dmg

Can anyone else confirm?

pmcgurn
New Contributor III

I wrote up an install guide for their new agent that shipped at the end of June/early July. They changed from a PKG inside the shipped DMG, to a .app with support files. The install process changed a bit.

https://jamfnation.jamfsoftware.com/discussion.html?id=20565

The link they use in the Setup area is on s3.amazonaws.com URL, vs. the cdn.samanage.com one, and the file name has the version number in it, so it makes it pretty difficult to automate the download as part of the install script. I opted to just manually download it, repackage it with Composer, and script the rest.

I got nowhere with their support team in regards to providing a non-static download URL for the agent for scriptability.