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.
Anyone have any ideas?
Thank you,
Brandon
Solved! Go to Solution.
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'
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'
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.