Posted on 02-12-2015 01:14 PM
I've written an extension to basically grep the number from the name of a text file we used in our old imaging method to keep track of the image version installed on machines.
The file is /Restore/ Image Version 6.5.3.txt (Note the space at the beginning of the file, and we used RTF at one point in time and switched to TXT).
The script works on it's own, but no results are returned from the extension. the script is...
#!/bin/bash
Filename=`ls /Restore/ Im*`
if [ -z "$Filename" ]; then
Bar="N/A"
else
Foo=${Filename#/Restore/ Image Version }
Bar=${Foo%.*}
fi
echo $Bar
The data type is set to string, the inventory display is set to Extension attributes.
Is there a place to look and see the results of extensions so I can see what the problem is?
Solved! Go to Solution.
Posted on 02-12-2015 01:18 PM
You need to echo the results with echo "<result>$Bar</result>" in order for it to show up in extension attributes.
Posted on 02-12-2015 01:18 PM
You need to echo the results with echo "<result>$Bar</result>" in order for it to show up in extension attributes.
Posted on 02-12-2015 05:58 PM
Yep. That was it. D'oh! :-)