Skip navigation

Post updated 1/24/15


With the SP1 release of Configuration Manager 2012 support for certain Linux distributions as a client platform has been introduced.  Interestingly enough, they’ve added a WMI type mock up that the client uses to interact with and gather data from these varied distributions.  It’s not a perfect solution, but certainly a step in the right direction.  I’ve spent a fair amount of time working through some of the Linux client problems (within Redhat) and have built an installer, and service control script, along with cron jobs to overcome some of the faults I’ve seen with the client failing to perform certain tasks in a timely fashion.

Before using any of my code, I recommend reviewing the Linux Configuration Manager installation documentation provided via Technet.  I’d also encourage you to read up on managing these clients from the Technet as well.  It’s fairly straight forward, but as I stated before it’s not a perfect solution.  I’ve found problems with zombied threads of the client on the box preventing policy updates, or needs for random restarts of the omiserver etc.

You are welcome to use parts of or all of the provided code as you see fit in your environments of course:

This first portion is a service control script that works for the Redhat distrubtions of the client.  I place this within the bin of all my assets to give simpler control of the services and for simplified cron entries.

#!/bin/bash

#CM Client Script
#Author: Daniel Belcher
#Date: 8/7/13 Modified: 1/19/15
#This script is intended for automation of services by cron and simpler
#asset management through the command line

#LDIR="/var/log/"
#DATE=`date '+%m%d%y'`
RUID=0
CCMEXEC="/opt/microsoft/configmgr/bin/ccmexec"
if [ "$UID" -ne "$RUID" ]
        then
        echo "User needs to be root to run $0 $1"
                exit 1
fi

start () {
$CCMEXEC
        sleep 1
echo
        exit 1
}

stop () {
$CCMEXEC -s
        sleep 1
echo
        if $(ps aux | grep [c]cmexec.bin) > /dev/null
        then
                kill $(ps aux | grep [c]cmexec.bin | awk '{print $2}')
        fi
exit 0
}

restart () {
$CCMEXEC -s
        sleep 2
                if [ $(ps aux | grep [c]cmexec.bin) ]
                then
                        kill $(ps aux | grep [c]cmexec.bin | awk '{print $2}')
                fi
        sleep 1
$CCMEXEC
        sleep 1
echo
        exit 0
}

trimlogs () {
        if [ ! $2 ];then
                SIZE=2048
        else
                SIZE=$(( $2 * 1024 ))
        fi

rollover $SIZE "/var/opt/microsoft/scxcm.log"
rollover $SIZE "/var/opt/mirorosft/scx/log/scx.log"
rollover $SIZE "/var/opt/microsoft/scx/log/scxcimd.log"
rollover $SIZE "/var/opt/microsoft/scxcmprovider.log"
}

rollover () {
FILESIZE=$1
LOGPATH=$2

if [ -f $LOGPATH ];then
LOGSIZE=$(du ${LOGPATH} | awk '{print $1}')
        if [ $LOGSIZE -gt $FILESIZE ];then
                cat /dev/null > $LOGPATH
                        echo "Clearing entries in $LOGPATH"
        fi
fi
}

policy () {
$CCMEXEC -rs policy
        sleep 1
echo
        exit 0
}

hinv () {
$CCMEXEC -rs hinv
        sleep 1
echo
        exit 0
}

sinv () {
$CCMEXEC -rs sinv
        sleep 1
echo
        exit 0
}

case "$1" in
        start)
                start
        ;;
        stop)
                stop
        ;;
        restart)
                restart
        ;;
        policy)
                policy
        ;;
        hinv)
                hinv
        ;;
        sinv)
                sinv
        ;;
        trimlogs)
                trimlogs $2
        ;;
        *)
                echo $"Usage: $0 (start|stop|restart|policy|hinv|sinv|trimlogs)"
                exit 1
esac

This next portion is a simplified installer script that can be used to build a unified installer for your environment that I’m currently using (it also places the script from above, and imports the cron jobs I’ve created).  It’s still required to place the client install files in the folder with this script of course:

#!/bin/bash

RUID=0
MP="management.point.server.com"
SITECODE="ABC"
if [ "$UID" -ne "$RUID" ]
        then
        echo "User needs to be root to run $0"
                exit 1
fi

if [ -f "fix-lib.sh" ]; then
        ./fix-lib.sh
fi

./install -mp $MP -sitecode $SITECODE -clean ccm-Universalx64.tar
        cp configmgr /bin/
#               crontab cm-crontab

sleep 5
configmgr stop
        sleep 30
cp scxcmprovider.conf /opt/microsoft/omi/etc/
if [ -f "/opt/microsoft/omi/scxcmprovider.log" ]; then
        echo "Moving scxcmprovider.log to /var/opt/microsoft/"
                mv /opt/microsoft/omi/scxcmprovider.log /var/opt/microsoft/
fi
configmgr start

These are the cron entries, to be used as an example:

#---Begin Configmgr Jobs---
0 0 * * 2,4,7 configmgr restart
1 * * * * configmgr policy
0 12 * * * configmgr hinv
0 8 * * 3 configmgr sinv
0 * * * * configmgr trimlogs 5
#---End Configmgr Jobs---

For more information regarding cron and what these entries mean, please read this.  They do a nice job of explaining this in a fairly straightforward manner.

Putting it all together….

This following link contains the tar.gz that can be used to install from.  Be mindful to read the README file and update the cm-installer script before you begin to insure you are pointing to a proper site.

Redhat CM12 Client Installer.

A further note that the Red Hat install I’m using here is based off the universal x64 binaries and will work for a lot of different distributions. Be sure to verify your distribution against the required package and substitute as needed.

I’m on a cut diet, so that means limited condiments.

Limited condiments means I start using tons of hot sauce again.

Tons of hot sauce means I get into a weirdly passionate state of being towards different hot sauces.

Right now, Sriracha.

I’ve got a few technical posts I want to get written up as soon as I can find some time. Until then, remember, “it’s only after we’ve lost everything that we are free to do anything” lol.

I’ve just been spending a lot of my limited free time lately (what’s not spent with my family), playing Planetside 2 and Smite.  Both are competitive play games, and being involved with a competitive team, you can imagine the level of  dedication exceeds that of the normal nerd level of play.

Which let me plug my refer-a-friend link in smite while I’m at it.  If you are interested in playing it with me, you can use this link to setup your account.  Just click play for free, and create an account.  If you already played tribes and global agenda you should already have a Hi-rez account and can leverage that.

I know about planetside 2 because you’ve talked about it before, but what is smite?

I’m glad you asked:

Smite is a third-person MOBA (multiplayer online battle arena), a style of action strategy games popularized by DotA (Defense of the Ancients) in the late 90’s early 00’s as a mod for warcraft 3.

The general concept and game mode circles around 2 bases, connected by 3 lanes, that are defended by turrets with a continual line of attackers spawned per lane lovingly referred to as minions.  The minions job is to be countless, and to dive continually to their deaths in the assault on the enemies base.  The job of the player (you) is to insure these minions deaths serve the greater purpose of gaining you experience and gold and to aid in the destruction of turrets and bases by being your fodder.

Sounds easy right?  Yea, it would be if you weren’t facing 5 other players who want to do the same thing, oh, and they want to KILL YOU.  So 5 v 5 action/strategy combat is born.

What separates Smite from other MOBA’s aside from the character concepts is the third person perspective in play and that all abilities and attacks are considered skill shots (meaning you have to aim them).  The games are faster paced than traditional MOBA’s as well which makes it a blast for someone like me to play.

Much like other games in it’s genre there are multiple play types: Arena, Domination, Conquest (traditional mode), Assault (random hero single lane conquest), Joust (1v1), Joust (3v3), and a random game mode referred to as Mode of the Day.  Mode of the day is usually pretty interesting because of some of the silly combinations they come up with forcing some unique character perspectives in play.

If you end up playing, let me know, you can friend me as lot3k (think low tech).

So I’m watching Mace Windu in action, then something occurred to me.

 

jedimindtrick

Anyway, I laughed pretty hard at this realization.

Mind = blown

I’m going to make this a very short post, but in a nut shell, sum up my thoughts and primary concern with the chief issue in this upcoming generation right now.

DRM

This isn’t a new issue with gaming.  This has been an issue that the PC gaming scene has largely dealt with, going back as far as requiring the CD in drive to play a game.  However I’m not here for a history lesson, but to address a very serious concern I have with Sony not playing ball on this restrictive model.

Publishers (a.k.a. Satan) view any and all content resale as a direct impact on sales revenue.  With this in mind, the Xbox ONE would appear to be a more preferable platform for developers/publishers.  So my concern is the loss of certain publisher support for the Playstation platform as a whole.

However, my 2 cents.  I don’t care because most of my gaming is done on a PC where I’m already happily a slave (in large part) to this no resale business model (THANKS STEAM FOR MAKING IT SO EASY! <3) .  I (speaking out of the other side of my mouth now) can’t support this business model and will not be contributing money towards it, eventhough 9/10 of my video game purchases are retail.  Perhaps Microsoft will work things out in similar fashion as valve so the consumers see a return through game price drops and crazy summer sales, but from what I’m reading, that doesn’t seem likely.

So I’ve been playing Planetside 2 lately.  I’ve been playing as New Conglomerate with an outfit called The Iron Wolves [TIW] on Waterson.  Coincidentally Planetside 2 is heading towards MLG and in the war report interview this past Sunday Higby in an interview with Alex “Jax” Conroy has revealed a lot of what that will entail (finally!).

Anyway, I’ve not made a post since mother’s day so I thought I’d link the youtube replay of our match from this past Friday against VREV and TRAF.  The second objective battle is by far one of the best (in around 10 minutes), with the third base capture having some entertaining points.

On the very early morning of December 27th 2007, my wife became more than herself.  She became a mother.

She worked, and toiled to do everything she could to ensure that this new life dependent on her had everything he needed.  Her self interest and importance became a secondary drive towards that of the new calling she found in Will.  Even leaving her job to become a stay at home mom to care for this new addition to our family.

Then again, on a very early morning of Sept 7th 2010, my wife moved forward to become a mother to yet another child.  Our sweet little baby girl Maggie.  Our daughter however had special needs; and my wife, the mother, heeded the heightened call and began working continually with her to try and better her.  Reaching to a place in her heart, and physical being to produce an endurance that surpasses my understanding.  To show interest to our son, to let him know that he too is loved, and that his little sister was a joy, not a burden to take his mommy from him.

When we thought we could take no more, that our line was running short; this beautiful woman found she was pregnant with our next child.  Born Sept 17th 2012 was Jake, and she again found a level of endurance and ability that makes me feel as if I’m hopelessly left behind as she runs this marathon.  Catching but a glimpse of her dust as she carries on in this race.  Carrying the burdens of bottles, therapies, dinners, diapers, discipline, she shows a compassion and a heart that could only be found in a mother.

Amanda, you are amazing.  I’m thankful to God that I have a wife like you, and am ever impressed with you, the mother.

I love you.

As some of you know, I’ve been working on CM 2012 for a while now, and establishing a hierarchy.  One of the unfortunate tasks with this job has been boundary creation.  Finally after a longer period than it should have taken I went to build a tool to create site boundaries for me out of a csv, similar to tools with SCCM 2007.

I found the sms_boundary class hadn’t changed (outside of an obsolete boundaryflag property) so I decided to test it out with powershell as a one liner, and it worked great.  I did a bit more research and stumbled across something already written by MVP Kaido Järvemets from Estonia, and enjoyed his minimalistic script for it so I followed his methodology (mostly) and ended up with this script that reads from a boundaries.csv file

boundary

 

$sitecode = "ABC"
$siteserver = "mysiteserver"
$boundarylist = Import-Csv '.\boundaries.csv'

foreach($Item in $boundarylist)
{Switch($item.'type')
	{"Subnet" 	{$Type = 0}    
	 "AD" 		{$Type = 1}
     "IPv6" 	{$Type = 2}
     "Range" 	{$Type = 3}}
$arrValues = @{DisplayName = $Item.description; BoundaryType = $Type; `
Value = $Item.boundary}
Set-WmiInstance -Namespace "Root\SMS\Site_$sitecode" -Class SMS_Boundary `
-Arguments $arrValues -ComputerName $siteserver}

Not to take credit for other peoples work, especially since this is a hacked up version of his original which can be found here.

image

All that remains.

So last week we lost our second dog to cancer. My corgi Keenan who’s been with us for 9 years has left us. I’ve not really been able to talk or write about it but my wife has done a good job with it here: http://thebelcherfamily4.blogspot.com/2013/03/farewell-friend.html?m=0

I loved that dog, and am thankful for the time we had with him. He’s been with us a relatively long time.

There is definitely something missing in our home now.