cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 9

SAM Linux Command Script Reporting

Jump to solution

I built a bash script for some of our Ubuntu servers to get the number of updates available and if the server needs a reboot. This way we can get them taken care of during maintenance windows without needing to log into them all and check for what is needed. The problem I have now is that I cannot figure out how to make a report for this. A web report would be great but I don't mind building something custom in SQL/SWQL if needed but I can't figure out what table keeps the data for me to reference.

This is the script I put together. It's pretty simple and less than perfect but it gets the job done.

#!/bin/bash

updates=$(cat /var/lib/update-notifier/updates-available)

echo $'Statistic.Updates: 1'

echo $'Message.Updates:' $updates

if [ -f /var/run/reboot-required ]; then echo $'Message.RestartCheck: ******Restart Required******';else echo $'Message.RestartCheck: No Restart Needed'; fi

if [ -f /var/run/reboot-required ]; then echo $'Statistic.RestartCheck: 1';else echo $'Statistic.RestartCheck: 0';fi

The app recognizes the outputs and displays the data in the web UI and even tracks the changes so I would have to think that its stored somewhere.
pastedImage_6.pngpastedImage_8.png

Anyone have any ideas?

Thank you,

Brandon

Labels (1)
0 Kudos
1 Solution
Level 9

Figured it out after starting to make a ticket with Solarwinds TS. It came up as a possible solution to my subject. The link it gave me was: Create SAM component report that includes Multivalue Messages and Component Messages - SolarWinds Wo...

The query that I needed was

SELECT NodeId,

    NodeName,

    ComponentName,

    ApplicationName,

    ComponentMessage,

    MultiValueStatistics,

    MultiValueMessages

FROM [SolarWindsOrion].[dbo].[APM_AlertsAndReportsData]

WHERE ComponentName = 'Linux Command'

View solution in original post

0 Kudos
1 Reply
Level 9

Figured it out after starting to make a ticket with Solarwinds TS. It came up as a possible solution to my subject. The link it gave me was: Create SAM component report that includes Multivalue Messages and Component Messages - SolarWinds Wo...

The query that I needed was

SELECT NodeId,

    NodeName,

    ComponentName,

    ApplicationName,

    ComponentMessage,

    MultiValueStatistics,

    MultiValueMessages

FROM [SolarWindsOrion].[dbo].[APM_AlertsAndReportsData]

WHERE ComponentName = 'Linux Command'

View solution in original post

0 Kudos