A user had some trouble adding the "Check Profile Sizes" Script in ControlUp and asked for help with finding the script’s data. Another user suggested adding some tags to the end of the script to fix the issue. The correct way to add data to the script was shared, and the first user confirmed that it worked. Further discussion included the placement of a report and the accessibility of this feature within the product.
Read the entire ‘Adding Data to ControlUp Scripts for Enhanced Functionality’ thread below:
I added a Script called Check Profile Sizes. After we run this script on our Devices, where do I find Data/Information output?
if you have configure the script to send data to an index and defined an unique index name in the script you can see the index & data under conmfiguration data
I added this Index to the script, but do not see it when I search under configuration data.
than something is off in the script, can you please share run the script manually and share the json? If possible also share the script please
The script needs the sip data begins and end tags or else you will not have any output.
I added this one from Control Up – https://www.controlup.com/script-library-posts/check-profile-sizes/
https://support.controlup.com/docs/scripting-guide
That script is for realtime. You’ll need to add the tags to it.
Look at the data collection section of that article.
yeah that script needs some work before it will work
This is what I have at the end of the script:Write-Output "Complete"
Write-Output("### SIP EVENT BEGINS ###")
Write event text to stdout here
Write-Output("### SIP EVENT ENDS ###")
Does that look correct to get the Data?
nope that writes an event
see https://support.controlup.com/docs/scripting-guide#creating-json-formatted-output
Do I add this too the end of the script:$MyData = @{} # initialize a hashtable
$MyData["field_1"] = 20
$MyData["field_2"] = 100
Write-Output("### SIP DATA BEGINS ###")
Write-Output(ConvertTo-Json $MyData -Compress)
Write-Output("### SIP DATA ENDS ###")
that might work, make sure the json is only a single level deep but this does that
@member I am not sure what you mean by "make sure the json is only a single level deep" appreciate the help. I will try adding this at the end and will let you guys know if it helps.
@member Thx for the help with my question on this script. Appreciate the help!!!
this is one level : {
"firstName": "Bidhan",
"lastName": "Chatterjee",
"age": 40,
"email":"[bidhan@example.com](mailto:bidhan@example.com)"
`}`
this is two levels: {
"Students": [
`{ "Name":"Amit Goenka" ,`
"Major":"Physics" },
`{ "Name":"Smita Pallod" ,`
"Major":"Chemistry" },
`{ "Name":"Rajeev Sen" ,`
"Major":"Mathematics" }
`]`
`}`
Adding $MyData = @{} # initialize a hashtable
$MyData["field_1"] = 20
$MyData["field_2"] = 100
Write-Output("### SIP DATA BEGINS ###")
Write-Output(ConvertTo-Json $MyData -Compress)
Write-Output("### SIP DATA ENDS ###")
I was able to go into Configuration, Data Choose my unique index name, I was able to run a repot. Appreciate the help @member
More than welcome 🙂
Just FYI, the feature is built-in the product
It’s not super easy to access to be honest 😉
I known it was there and it took me 10 minutes to find where it was…
😄
@member Thx, I will take a look. Appreciate the help!!!!
Continue reading and comment on the thread ‘Adding Data to ControlUp Scripts for Enhanced Functionality’. Not a member? Join Here!
Categories: All Archives, ControlUp Edge DX, ControlUp Scripts & Triggers