can we run simple bash sript in cron in xoa?
-
can we run simple bash sript in cron in xoa?
I have almost oneliner to run by few secont to ask snmp (...). Is this possible tu put script somewhere in xoa? I don't want to multiple entitities.
-
Can you describe exactly the need? (to see if we can cover it in XO). Otherwise, I don't see any issue to use cron.
-
I wrote this script to monitor battery level via snmp, and in case low battery level I want to do some actions
I guess I could put it directly in XCP but for best measures I want to avoid any non standard configuration changes - becaouse I'll later simply forget about it.#!/bin/bash UPSBatteryLevelCheck="$(snmpget -v1 -c public ups01 .1.3.6.1.4.1.43943.1.1.3.4.0| sed -n 's/.*INTEGER: //p')" if [ "$UPSBatteryLevelCheck" -lt "50" ]; then subject="Subject: Alert UPS01 - low battery level" body="UPS01 Battery Level below 50%" from="sen@d.er" to="em@a.il" echo -e "Subject:${subject}\n${body}" | sendmail -f "${from}" -t "${to}" fi
-
Are you using XO from sources?
If yes, this XO will run inside a regular VM and therefor I'd say yes, you can put this script into crontab.If you are using the XOA appliance I wouldnt recommend it just due to the fact that they could blame it incase anything goes wrong
-
I can put the script everywhere - but I want to avoid non standard config. In case of failure of {system} I'm reinstalling it, and restoring config from file. I don't need to remember that I've put some fancy staff somewhere on the lan.