One of our devs would love to have nice historical data reside in SAM about the number of active users on a Solaris box.
He's going to add the script to a nightly cron job, which in turn outputs it to a file on said box.
Is there a method for having SAM pull data out of that result file and populate the Solarwinds DB?
Thanks for any info.
Solved! Go to Solution.
I was trying out the template and i may need some more help.
So the txt file gets generated everyday in below format to a particular path.
So how do i mention the path in the arguments so that it finds this txt file? I will put the string in the regex parameter.
M is correct, to add to this we skirt around it by putting in a clause along the lines of:
If output = expected, statistic = 0.
Else, statistic = 1 and then set the component that anything > 0 is critical.
You can do this with exit codes if you want the status to be actually down, for example, but for us it's usually that or returning a count of components in a bad status which allows for easy alerting.
Sorry i wasnt clear in my earlier statement.
I know the path will go into that place where u mentioned, but if u look at the screenshot then the file that gets generated has a date change everytime so its not unique..
So in this case, how do i mention the path till the text file?
That is not possible with the template as it is currently written. The script within the template is expecting a static file name. The script would need to be adapted to look at the last modified or last updated date/time of the files in a file system to ensure it's always looking at the lastest.
Okay, got some more info and my desired task is even simpler than I thought - but I'm having a challenge finding the way to quickly accomplish it.
It's not a script per se - instead, it's the output of this command:
who | cut -f1 -d " " | sort | uniq | wc -l
It returns one numerical value.
My goal is to build a component monitor or other mechanism to perform this command, take the output and get it into Solarwinds.
What the heck am I missing? It sure seems like this should be possible.
Thanks for any info.
Put this in a Linux monitor:
Value=`who | cut -f1 -d " " | sort | uniq | wc -l`
echo "\nStatistic: $Value";
echo "\nMessage: This is your value"
Obviously you can change the \nMessage to whatever pleases you. Note that before the who and after the -l is the back ticks.
I'm still missing something - getting barked at on testing it with
Get Output Failed: Can't identify dynamic column definitions from script output...
I'll keep at it...gotta be something small. Thanks.
SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community. More than 150,000 members are here to solve problems, share technology and best practices, and directly contribute to our product development process. Learn more today by joining now.