Creating a automatic baseline and schedule it

Hi All,

I have one requirement, to create a baseline from the list of fixlets which i have in excel sheet.
also want to schedule that baseline but not through tem console but using some external tool or api
can someone please give me a short example which will give me an idea about it , maybe a example of small baseline automatically created through some script / api . thanks

@Darknight1, Can you provide explain why you have an Excel sheet with fixlets and where that data is being generated from?

From what you’ve described, you could potentially leverage the REST APIs that are exposed on the root BES server to accomplish the necessary steps. There’s a good REST API wiki on the DevWorks site that has code examples.

@cmcannady … thanks for your reply and help… i have tried to open the rest api link which you have mentioned … but it just goes to Public Wikis page…could you provide me the exact link to look for… that will be very helpful :slight_smile:

@Darknight1, here’s the URL from my browser bar. Not sure why it didn’t come through with my previous post.

https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli+Endpoint+Manager/page/REST+API

We’re building a good deal of functionality arount the IEM REST API in order to abstract the tool from our end users.

If you’re still having trouble with that link, try this one: https://www.ibm.com/developerworks/community/wikis/home/wiki/Tivoli%20Endpoint%20Manager/page/REST%20API

There are also REST API examples on https://github.com/bigfix/restapi-examples

There aren’t specific functions for baselines, but they are just another type of content that you can import using the IMPORT function. The easiest way to figure out the XML for any object you want to add via REST API is to first construct it (or an example of it) in the console. Then right-click and Export it to get the .bes file. That is the same style XML you should pass to the import call.

@cmcannady and steve…than you very much for your extended help…let me go through these links and try to test it… i will definitely get back to you with my further querries…thanks and looking forward for your support :smile:

i have gone through the links and but still i am not bale to start up with the baseline automation.
Could you please give me soem hint about how to go further in automating the baseline creation in below scenario
we will be ready with the sheet/list of patches/fixlets that needs to be applied as a baseline to selected servers.
Now i want to automate the process of finding out these fixlets and then create a baseline out of it and apply or schedule it as per the timeline with all the other execution opions.

Could you please suggest so that i can get a hint or idea …thanks

Did you try my suggestion of creating a baseline in the console and exporting it? Then take the resulting .bes file and pass that as the payload on the import API call. Using our iem.exe CLI tool (in the BES Server directory), the syntax would be:

iem POST “baseline.bes” import/operator/op1

where op1 is the name of the non-master operator. To import to a custom site or as a master operator, you would change the last part to import/custom/Custom%20Site%20Name or import/master

Once you’re comfortable creating the baseline, then you can work on the queries to find the fixlets to include in the baseline and constructing the baseline XML. To query for fixlets you’ll need to get the ids of the specific fixlets you want to include using GET fixlets/external/Enterprise%20Security and then get the details of it using GET fixlet/external/Enterprise%20Security/. Alternatively, you can construct a relevance query to return the fixlet details, and get the relevance results using GET query.

@steve : Thanks a lot … yes indeed i tried to create a baseline the way you suggested. i have one question over here… what we are planning is to give console operator freedom to

  1. create the baseline.bes as per their requirement using iem.exe and let them import it on their cosole.

So is it possible by which we can make iem.exe available to other console operators (maybe publish it on citrix instance) and then they can import the baseline.bes filw into their individual operator site?

also could you give me a small example or some links which shows the use of session relevance in combination with GET query.

Thanks for the help and assitance:)

They don’t need access to iem.exe to import the baseline into their console. They just need to double-click on the .bes file on their console system to trigger an import.

Hey guys … let me also ask a question on this tread as I am doing the same thing… I already created the baseline using a XML template and importing it to a custom site (thanks for the tips above btw) fixlet id 21328.

I am able to schedule it using the default settings for POST action, but I am wondering now how to add to the action XML settings like (Reapply), (ReapplyLimit), (DayOfWeekConstraint) and so on…
To export a submitted action and through the tags below in there didn’t work.
(SourceFixlet)
(Sitename)Autopatch - RedHat(/Sitename)
(FixletID)21328(/FixletID)
(/SourceFixlet)

This is what I am doing so far:
cat take_action_site.xml
BES xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=“BES.xsd”)
(SourcedFixletAction)
(SourceFixlet)
(Sitename)Autopatch - RedHat(/Sitename)
(FixletID)21328(/FixletID)
(/SourceFixlet)
(Target)
(CustomRelevance)exists true whose (if true then (member of group 21323 of site “actionsite”) else false)(/CustomRelevance)
(/Target)
(/SourcedFixletAction)
(/BES)

curl -k -u “user” -X POST --data-binary “@take_action_site.xml” “https://IEM:52311/api/actions
(?xml version=“1.0” encoding=“UTF-8”?)
(BESAPI xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=“BESAPI.xsd”)
(Action Resource=“https://IEM:52311/api/action/21329” LastModified=“Wed, 08 Apr 2015 22:45:53 +0000”)
(Name)Custom Baseline - AutoPatch Linux - v4 - Apr, 06 2015(/Name)
(ID)21329(/ID)
(/Action)
(/BESAPI)

PS: I replaced the < by ( and > by ) so it’s not converting

Export an action from the console that has those settings and use that as a guide. Also use the BES.xsd schema as a guide.

Hi, I already tried that… if I export an action from the console it will come with the actionScript tag…
(ActionScript MIMEType=“application/x-Fixlet-Windows-Shell”)// Enter your action script here(/ActionScript)

I was wondering how to add the tag FixletID X from the Sitename Y:
(Sitename)Autopatch - RedHat(/Sitename)
(FixletID)21328(/FixletID)

So it would execute the baseline from the customsite that I specify.

I have a partial solution that will automatically create a baseline:


Related Posts:

The source fixlet tags are different than action settings like start time, reapply, etc. If you just want to deploy your existing baseline, use the SourcedFixletAction XML seen here:
https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/RESTAPI%20Action

You can include <ActionSettings> tags in that XML for the other settings per jgstew’s suggestion.

2 Likes