Quantcast
Channel: THWACK: Discussion List - All Communities
Viewing all articles
Browse latest Browse all 16365

Run a linux script

$
0
0

Hi All,

I want solarwinds SAM to run a linux script, but I am a complete newbie at this so not sure how to go about.

 

This is the script mysql -uroot -e"show slave status\G;" | grep "Seconds_Behind_Master" | awk -F": " {' print $2 '} if it returns a value of NULL, I want to send an alert and if it's anything other than null (it's an integer value) all is ok.

 

I've made the following script component but doesn't appear to work.

 

#!/bin/bash

status= 'mysql -uroot -e"show slave status\G;" | grep "Seconds_Behind_Master" | awk -F": " {' print $2 '}'

 

if [[$Status = NULL]]; then

    echo "Statistic: 1"

 

else

   echo "Statistic: 0"

fi

 

Thanks in advance.

Mas


Viewing all articles
Browse latest Browse all 16365

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>