Skip to main content
Solved

Deploying Samanage Software on macs

  • January 21, 2016
  • 9 replies
  • 19 views

Forum|alt.badge.img+10

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

Best answer by thoule

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.

9 replies

Forum|alt.badge.img+15
  • Contributor
  • Answer
  • January 21, 2016

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.


Forum|alt.badge.img+33
  • Hall of Fame
  • January 21, 2016

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_install


Forum|alt.badge.img+10
  • Author
  • Valued Contributor
  • January 21, 2016

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


mpermann
Forum|alt.badge.img+22
  • Valued Contributor
  • January 21, 2016

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


Forum|alt.badge.img
  • New Contributor
  • May 20, 2016

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


Forum|alt.badge.img+5
  • Contributor
  • July 5, 2016

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


Forum|alt.badge.img+10
  • Author
  • Valued Contributor
  • July 5, 2016

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


Forum|alt.badge.img+6
  • New Contributor
  • July 12, 2016

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?


Forum|alt.badge.img+5
  • Contributor
  • July 19, 2016

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.