I am using a simple little tool caled BFExtractToCSV (Google to download it…)
This tool runs a script and then dumps out the data to a CSV. Then we have Service Now server picking up the csv file from a network share and import the data in to it…
Here are my Scripts…
I put this on one of my relay servers and I created a bat file
Run.bat (I created a windows scheduled job to run with a service account that has rights to web reports… And I scheduled it to run one a week…)
d:\BFExtractToCSV\BFExtractToCSV.exe -U servicenowexport -P servicenowexport -webreport http://epmreports -CustomQuery "servicenowexport"
more +2 servicenowexport.csv > SNE_Final.csv
more +2 servicenowexport.csv > D:\BFExtractToCSV\ServiceNowExport\SNE_Final.csv
queriesConfig.yaml (This is the config file with a bunch of examples I put my service now querie at the bottom…)
ComputerInfo:
relevance: (id of item 4 of it as string &"~;~" & (name of item 4 of it |"") as string &"~;~" & (operating system of item 4 of it |"") as string &"~;~" & (cpu of item 4 of it|"") as string &"~;~" & ((value of result (item 4 of it, item 2 of it)) | “”) as string &"~;~" & ((value of result (item 4 of it, item 1 of it)) | “”) as string &"~;~" & ((value of result (item 4 of it, item 3 of it)) | “”) as string &"~;~" & (last report time of item 4 of it as string|"") as string &"~;~" & (locked flag of item 4 of it as String |"") as string &"~;~" & (relay selection method of item 4 of it|"") as string &"~;~" & (relay hostname of item 4 of it|"") as string &"~;~" & (relay distance of item 4 of it as string |"") as string &"~;~" & (hostname of item 4 of it|"") as string &"~;~" & ((concatenation " " of ((ip addresses of item 4 of it as string))) | “”) as string &"~;~" & ((concatenation " " of (values of results (item 4 of it, item 0 of it))) | “”)) of (item 0 of it, item 1 of it, item 2 of it, item 3 of it, bes computers) of (bes property whose (default flag of it AND name of it = “Subnet Address”) , bes property whose (default flag of it AND name of it = “Free Space on System Drive”) , bes property whose (default flag of it AND name of it = “RAM”) , bes property whose (default flag of it AND name of it = “BIOS”))
delimiter: “~;~“
headers:
- Computer ID
- Computer Name
- Operating System
- CPU
- RAM
- Free Space on System Drive
- BIOS
- Last Report Time
- Is Locked
- Relay Selection Method
- Relay Hostname
- Relay Distance
- Hostname
- IP Addresses
- Subnet Addresses
ComputerProperties:
relevance: (id of item 1 of it as string &”~;~” & (name of item 1 of it |"") &"~;~" & ((concatenation “~;~” of ((if exist results (item 1 of it, item 0 of it) then ((if (error flag of it) then (error message of it) else (concatenations “, " of (values of it))) of results (item 1 of it, item 0 of it)) else “”) of (item 1 of it, elements of item 0 of it))) |”")) of (it, bes computers) of set of bes properties (%propertyNames)
delimiter: "~;~"
headers: (“Computer ID~;~Computer Name~;~”) & concatenation “~;~” of names of elements of set of bes properties (%propertyNames)
FixletInfo:
relevance: (id of it as string & “~;~”& name of it & “~;~”& name of site of it& “~;~”& applicable computer count of it as string & “~;~”& (display source severity of it|"")& “~;~”& (number of actions of it as string )& “~;~”& (category of it | “”) & “~;~” & (download size of it as string | “”) & “~;~”) of fixlets of bes site whose(name of it = “%siteName”)
delimiter: “~;~“
headers:
- Fixlet ID
- Fixlet Name
- Site Name
- Applicable Computer Count
- Source Severity
- Action Count
- Category
- Download Size
AnalysesResults:
relevance: (id of item 1 of it as string &”~;~” & name of item 1 of it &"~;~" & concatenation “~;~” of (values of results (properties of item 0 of it, items 1 of it)) ) of (it, applicable computers of it) of fixlet whose(id of it = %fixletID) of bes site whose( name of it = “%siteName”)
headers: (“Computer ID~;~Computer Name~;~”) & concatenation “~;~” of names of properties of fixlet %fixletID of bes site whose(name of it = “%siteName”)
delimiter: “~;~“
Actions:
relevance: (id of it as string &”~;~” & name of it &"~;~" & name of issuer of it &"~;~" & state of it as string &"~;~" & time issued of it as string &"~;~" & multiple flag of it as string ) of bes actions
headers:
- Action ID
- Action Name
- Issuer Name
- State
- Time Issued
- Multiple Action Group
delimiter: “~;~“
ActionResults:
relevance: ((Name of Computer of it as string |””) &"~;~" & (ID of Action of it as string |"") &"~;~" & (Name of Action of it as string |"") &"~;~" & (Status of it as string|"") &"~;~" & (Detailed Status of it as string |"") &"~;~" & (Line Number of it as string|"") &"~;~" & (Retry Count of it as string | “”)) of results of bes actions whose( id of it = %actionID)
headers:
- Action ID
- Action Name
- Issuer Name
- State
- Time Issued
- Multiple Action Group
delimiter: “~;~”
custom:
relevance: now
delimiter:
servicenowexport:
relevance: (item 0 of it as string & “~;~” & item 1 of it as string) of ((if (exists result (item 0 of it , item 1 of it) and exists values of result (item 0 of it , item 1 of it)) then (concatenation “%0A” of values of result (item 0 of it , item 1 of it)) else ("")) , (if (exists result (item 0 of it , item 2 of it) and exists values of result (item 0 of it , item 2 of it)) then (concatenation “%0A” of values of result (item 0 of it , item 2 of it)) else (""))) of (bes computers , bes property “Computer Name” , bes property “Server Owner”)
delimiter: "~;~"
headers:
- Computer Name
- Computer Owner
So this simply inputs the Computer Name and Computer Owner into Service Now. We plan on adding more infor into the CMDB later on in the future… Like CPU,RAM… And All I have to do is add the fields into
Hope this helps…
I do agree with
mlmcgoug
And her statement of “I think these integrations can be as simple or complicated as needed.” She is 100% correct… We like to keep it very simple…
-Rene