Good Day All.
Just handed a new monitoring requirement, as follows:
Linux server runs a regular process to drop a text file onto a certain folder ("drop folder"), similar to below:
PROCESS1 VALUE1 OTHERVALUE1
PROCESS2 VALUE2 OTHERVALUE2
PROCESS3 VALUE3 OTHERVALUE3
...
The customer wants to ingest this file into Solarwinds, and then display the values in a Solarwinds console with rows and columns just like in the text file.
Other limitations: a) there are more than 10 lines in the text file, so it exceeds the maximum number of data elements returned by a script monitor, b) Solarwinds has an SSH login to the Linux host, but the system owners don't want to give that account any permissions other than to read the file drop folder, c) agent for Linux is not an option for now.
Best solution I can come up with is to...
- assign the contents of the text file to a variable (Bash script)
- send that loooooong string variable to Solarwinds in the 'Message' part of a return variable
- use SQL to parse that text string into rows and columns in the data source of the display widget
I've been researching the SQL part on the Internet, and it seems like SQL can in fact parse a text string into rows and columns. However... I'm at best a Padawan SQL coder. Getting lost in the complexity of these example queries (lots of CHARINDEX, LEFT, STUFF, and UNION ALLs).
Btw I am aware that Solarwinds no longer retains historical Message data from script monitors. So we have only the latest read to work with.
Can anyone in the community provide a good example of using SQL to parse a long text string into rows and columns for display in a Solarwinds widget? Also please advise if there is a better way to do this given the limitations.
Thanks in advance for any responses.