AnsweredAssumed Answered

Force Samanage Agent to check in on OSX. Does it work for you?

Question asked by matthew.hoffman@soundcloud.com on Oct 3, 2016

Does anyone force the agent to check in OSX? We are in a pre deployment and testing phase. We have been seeing mixed results with (computers) clients not showing up in our dashboard after the agent install.

 

I have been experimenting with the force checkin options listed within the cmb.rb file.

 

Does anyone use this?

If so I am curious if you also find this documentation to be correct for OSX.

The specified item was not found.

 

In my testing I had to modify 2 things. The location of the file is different when I install the agent.

 

This is where I am finding the cmb.rb file:

 

/Applications/SamanageAgent.app/Contents/Resources/agent/src/mini_kernel/cmd.rb

 

The second issue is that when I run the command the first line errors out:

 

 

/Applications/SamanageAgent.app/Contents/Resources/agent/src/mini_kernel/cmd.rb: line 1: syntax error near unexpected token `('

/Applications/SamanageAgent.app/Contents/Resources/agent/src/mini_kernel/cmd.rb: line 1: `RUNNING_DIR = File.expand_path File.dirnam'(File.dirname(File.dirname(__FILE__)))

 

I granted myself read/write access to the mini_kernel directory and the cmd.rb file in order to add this to the first line of the .rb file "#!/usr/bin/env ruby"

I didn't add the quotes. After doing this I was able successfully force the check in on 2 of my testing machines.

 

It does output some errors but the machine does show as being updated in my dashboard:

 

 

/Applications/SamanageAgent.app/Contents/Resources/agent/src/kernel/agent_kernel.rb:252:in `<module:HttpHelper>': uninitialized constant OpenSSL::SSL::OP_NO_COMPRESSION (NameError)

  from /Applications/SamanageAgent.app/Contents/Resources/agent/src/kernel/agent_kernel.rb:251:in `<top (required)>'

  from /Applications/SamanageAgent.app/Contents/Resources/agent/src/mini_kernel/cmd.rb:26:in `require_relative'

  from /Applications/SamanageAgent.app/Contents/Resources/agent/src/mini_kernel/cmd.rb:26:in `<main>'

 

This seems like a bit of a wacky/hacky work around. Is there any way to force the check in without having to modify this file?

 

I am attempting to use this as a way to resolve an issue where a machine isn't showing up in the dashboard after the agent install. This didn't fix it. Has anyone else seen this issue? Any input is helpful.

 

UPDATE:

So it looks like the hostname/localhost/computer name may have been the issue. It was set to a generic "MacBook Pro" name. After changing that the force checkin script worked and the computer asset that had not shown up properly showed up. This didn't require a re installation of the agent.

Outcomes