Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #change to directory holding bash script
- cd /srv/18ff8cb7-1878-42d2-954d-90d62ec9aef5/AppData/cron/smart
- #output smart status into smart.txt
- snapraid smart > smart.txt
- #parse the smart.txt file for drives names sda-sdd and output in 2.txt
- grep -o '/dev/sd[a-d]' smart.txt > 2.txt
- #add cumulative failure rate word to 2.txt
- echo cumulative >> 2.txt
- #parse out the failure rates and output to 4.txt
- grep -o [0-9]*[0-9]% smart.txt > 4.txt
- #combine all four text files together
- paste -d "" 1.txt 2.txt 3.txt 4.txt > /srv/18ff8cb7-1878-42d2-954d-90d62ec9aef5/AppData/cron/upload.txt
- #remove % signs from file
- sed -i 's/%//g' /srv/18ff8cb7-1878-42d2-954d-90d62ec9aef5/AppData/cron/upload.txt
- #upload to manual database in influxdb
- curl -i -XPOST 'http://192.168.99.160:8086/write?db=manual' --data-binary @upload.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement