You are on page 1of 15

SCCM

Simple Configuration Change Manager Rocco Lucia @rlucia

Configurations
Single Text files Single Binary files Multiple Files

Your Device Driver SCCM

SCM Repository

How does it work


Everything starts at midnight with a standard UNIX cronjob /usr/local/sccm/bin/sccm.sh

Under the hood


createpaths: prepares the file system updatecfg: reads configuration and execute the commands to fetch configurations from all the devices committall: checks for changes to configuration files, commits to the repository and prints all configuration changes... if any.

How to add a DEVICE


Create a driver for your device Add your device to the configuration

drivers/yourcode cfg/drivers.cfg

cfg/devices.cfg

Creating a Device Driver


You will write a script/code/monster that does whatever is necessary to DOWNLOAD CONFIGURATION FILE(S) OF YOUR DEVICE INTO A DIRECTORY

Creating a Device Driver


Ok, got it, so where do I start from?

1st, Write your Code


2nd, Integrate it into SCCM

Writing a Device Driver


Quite simple, this is a device driver:
$ cd /usr/local/sccm $ cat > drivers/mydevice.sh <<EOF #!/bin/sh scp myuser@myhost:superconfig.txt $1 ^D $ chmod a+x mydevice.sh

Integrate into SCCM


Identify the parameters you will use to get access to your device, e.g.:
Device

name its IP address the remote username the remote configuration file name

Integrate into SCCM


Lets map this things into SCCM drivers.cfg file:
mydevice => { scriptname => mydevice.sh params => IP,username,cfgfile }

Wow its easy!!!

Integrate into SCCM


Now you need to fix your script to parse the parameters specified in params (ORDER MATTERS):
$ cat drivers/mydevice.sh #!/bin/sh MYIP=$1 MYUSER=$2 MYCFGFILE=$3 MYCFGDIR=$4 scp ${MYUSER}@${MYIP}:${MYCFGFILE} ${MYCFGDIR} $

Youre done!

Add a Device to SCCM


Just add it to a device group section to device.cfg file:
%DEVICES = ( firewalls => { mainfirewall => { driver => mydevice, IP => 10.0.0.1, username => rlucia, cfgfile => /etc/pf.conf } } )

Lets wait until midnight... or manually run bin/updatecfg.pl

Wheres my history?
SCCM will store all configurations: /usr/local/sccm/configuration In that path there is is a working copy of the SVN repo at: /usr/local/sccm/repository Feel free to browse the repo to see how your configurations evolved...

Q&A

You might also like