Nine41 Consulting | If You Eat All of Your Vegetables…Then Deploy the LANDESK Agent
apple, device management, dep, vpp, systems management, landesk, ivanti, lanrev, absolute, heat, mdm,
31
post-template-default,single,single-post,postid-31,single-format-standard,qode-quick-links-1.0,ajax_fade,page_not_loaded,,columns-3,qode-child-theme-ver-1.0.0,qode-theme-ver-11.0,qode-theme-bridge,wpb-js-composer js-comp-ver-5.1.1,vc_responsive
 

If You Eat All of Your Vegetables…Then Deploy the LANDESK Agent

If You Eat All of Your Vegetables…Then Deploy the LANDESK Agent

If this…then that.

As human beings, we’ve been dealing with if/then conditional statements since our childhood. “If you clean your room, then you can go play,” or “if you eat all of your vegetables, then you can have desert.”

You’ve just had terrible flashbacks of being forced to consume all of the broccoli on your plate, haven’t you?

Well, as we grow up, the “if/then” conditions don’t go away. We may or may not know it, but nearly every application we use has some sort of conditional statement buried into the code. It’s how programmers can provide an experience to us as we make decisions interacting with their applications.

A programmer will provide us an option to choose from and based on the outcome of that choice, code has been written to provide the experience to match our choice.

When it comes to systems management, well, we love conditional statements just as much as Mom and Dad did. We have all sorts of scenarios we need to evaluate and then take action based on the results.

One of the most common scenarios of an if/then, when it comes to systems management, is simply verifying if a machine has the systems management agent installed. If it does, great, don’t do anything. If it doesn’t, well then install it.

Not too hard, right?

Well, life is never easy. There is always going to be some sort of exception to any process. You may have been able to discover 80% of your machines and push an agent installer to it. Perfect, you’re 80% there. For the other 20% though, that’s where all of the work is.

To help us in our scenario of getting machines enrolled into our systems management tool, let’s just write a little script that will detect to see if a LANDESK agent is installed or not. If it is, the script can simply exit out or provided feedback and then exit out. If an agent is not installed, then the outcome will be to download the agent, install it, and then clean up all of the install files. Ultimately, the end result is, you can run the detections on every machine and only effect change on those ever elusive twenty-percenters.

I’ve written an example script below that will detect to see if the LANDESK agent has been installed and then proceed appropriately, however, since the script contains variables; you’ll see that it is quite portable and could be adapted to many other types of scenarios.

#!/bin/bash
## replace “coreserver.mycompany.com” with your core server FQDN
## replace “MacAgent.mpkg.zip” with your agent name, remembering to appropriately handle spaces in the name if applicable.
CORE=”http://coreserver/mycompany.com/ldlogon/mac”
AGENTNAME=”MacAgent.mpkg.zip”

## detect if the agent is already installed
if [ -d “/Library/Application Support/LANDESK” ]; then
echo ‘The LANDESK Agent is Installed’
exit 1

else echo ‘The LANDESK Agent Needs to be Installed’

## download the agent
curl -# -O $CORE/$AGENTNAME

## unzip the downloaded agent
unzip $AGENTNAME

## install the agent
sudo installer -allowUntrusted -pkg “LDMSClient.mpkg” -tgt LocalSystem

## delete the files downloaded
rm $AGENTNAME
rm -rf “LDMSClient.mpkg”
exit 0
fi

For this script to function in your environment, copy it into a text editor such as TextWrangler or Notepad++. Modify the CORE variable as well as the AGENTNAME variable and then save it out as a .sh file. Then, leveraging a login process, such as a Group Policy login, or whatever tool or process you have, deploy out the script to all of your machines (after careful test validation of course). Since it’s a shell script, it just needs to be executed with a “./” command with superuser privileges.

In my environment, I saved the file as LDAgentInstall.sh. As such, for me to execute it, I ran “sudo ./LDAgentinstall.sh” and as can be seen in the screenshot, it returned the phrase “The LANDESK Agent is Installed.”

Screen Shot 2015-06-22 at 4.16.04 PM

No Comments

Post A Comment

ARE YOU READY TO GET STARTED?
Please fill out your information, and a specialist will reach out to discuss our services in more details.
Your Information will never be shared with any third party.
        
Free Training Videos
Register to gain access to all of our free content.
YOUR PHONE
YOUR NAME
YOUR EMAIL
        
Get Started
Provide us your contact information and we will reach out as quickly as possible.
YOUR PHONE
YOUR NAME
YOUR EMAIL
        
Additional Questions?
Provide us your contact information and we will reach out as quickly as possible.
YOUR PHONE
YOUR NAME
YOUR EMAIL
        
Pay by PO?
Provide us your contact information and we will reach out to help you sign up by PO.
YOUR PHONE
YOUR NAME
YOUR EMAIL
Subscribe Now
Subscribing to our site gives you access to our Apple Admin 101 training videos as well as allowing us to notify you of each new blog post we release.
YOUR PHONE
YOUR NAME
YOUR EMAIL
Pay by PO
Send us your contact information and we will reach out to help you sign up by PO.
YOUR PHONE
YOUR NAME
YOUR EMAIL
Additional Questions?
Send us your contact information and your questions and we will reach out as quickly as possible.
YOUR PHONE
YOUR NAME
YOUR EMAIL
YOUR QUESTIONS
Get Started
Provide us your contact information and we will reach out as quickly as possible.
YOUR PHONE
YOUR NAME
YOUR EMAIL
Free Training Videos
Subscribing to our site gives you access to our Apple Admin 101 training videos as well as allowing us to notify you of each new blog post we release.
FIRST NAME
LAST NAME
PHONE
EMAIL
Subscribe Now
Subscribing to our site gives you access to our Apple Admin 101 training videos as well as allowing us to notify you of each new blog post we release.
FIRST NAME
LAST NAME
PHONE
EMAIL