- name: Use the local Apt package cache.
become: yes
copy:
- content: |
- Acquire::http::Proxy "http://apt-cacher.{{ domain_priv }}.:3142";
+ content: >
+ Acquire::http::Proxy
+ "http://apt-cacher.{{ domain_priv }}.:3142";
dest: /etc/apt/apt.conf.d/01proxy
mode: u=rw,g=r,o=r
#+END_SRC
echo ""
print_usage
echo ""
- echo "This plugin checks hardware status using the lm_sensors package."
+ echo "This plugin checks hardware status using" \
+ "the lm_sensors package."
echo ""
support
exit $STATE_OK
brief_data() {
echo "$1" | sed -n -E -e '
- /^temp[0-9]+: +[-+][0-9.]+.?C/ { s/^temp[0-9]+: +([-+][0-9.]+).?C.*/ \1/; H }
+ /^temp[0-9]+: +[-+][0-9.]+.?C/ {
+ s/^temp[0-9]+: +([-+][0-9.]+).?C.*/ \1/; H }
$ { x; s/\n//g; p }'
}
case "$1" in
- --help)
- print_help
- exit $STATE_OK
- ;;
- -h)
- print_help
- exit $STATE_OK
- ;;
- --version)
- print_revision $PROGNAME $REVISION
- exit $STATE_OK
- ;;
- -V)
- print_revision $PROGNAME $REVISION
- exit $STATE_OK
- ;;
- *)
- sensordata=`sensors 2>&1`
- status=$?
- if test ${status} -eq 127; then
- text="SENSORS UNKNOWN - command not found"
- text="$text (did you install lmsensors?)"
- exit=$STATE_UNKNOWN
- elif test ${status} -ne 0; then
- text="WARNING - sensors returned state $status"
- exit=$STATE_WARNING
- elif echo ${sensordata} | egrep ALARM > /dev/null; then
- text="SENSOR CRITICAL -`brief_data "${sensordata}"`"
- exit=$STATE_CRITICAL
- elif echo ${sensordata} | egrep FAULT > /dev/null \
- && test "$1" != "-i" -a "$1" != "--ignore-fault"; then
- text="SENSOR UNKNOWN - Sensor reported fault"
- exit=$STATE_UNKNOWN
- else
- text="SENSORS OK -`brief_data "${sensordata}"`"
- exit=$STATE_OK
- fi
-
- echo "$text"
- if test "$1" = "-v" -o "$1" = "--verbose"; then
- echo ${sensordata}
- fi
- exit $exit
- ;;
+--help)
+ print_help
+ exit $STATE_OK
+ ;;
+-h)
+ print_help
+ exit $STATE_OK
+ ;;
+--version)
+ print_revision $PROGNAME $REVISION
+ exit $STATE_OK
+ ;;
+-V)
+ print_revision $PROGNAME $REVISION
+ exit $STATE_OK
+ ;;
+*)
+ sensordata=`sensors 2>&1`
+ status=$?
+ if test ${status} -eq 127; then
+ text="SENSORS UNKNOWN - command not found"
+ text="$text (did you install lmsensors?)"
+ exit=$STATE_UNKNOWN
+ elif test ${status} -ne 0; then
+ text="WARNING - sensors returned state $status"
+ exit=$STATE_WARNING
+ elif echo ${sensordata} | egrep ALARM > /dev/null; then
+ text="SENSOR CRITICAL -`brief_data "${sensordata}"`"
+ exit=$STATE_CRITICAL
+ elif echo ${sensordata} | egrep FAULT > /dev/null \
+ && test "$1" != "-i" -a "$1" != "--ignore-fault"; then
+ text="SENSOR UNKNOWN - Sensor reported fault"
+ exit=$STATE_UNKNOWN
+ else
+ text="SENSORS OK -`brief_data "${sensordata}"`"
+ exit=$STATE_OK
+ fi
+
+ echo "$text"
+ if test "$1" = "-v" -o "$1" = "--verbose"; then
+ echo ${sensordata}
+ fi
+ exit $exit
+ ;;
esac
#+END_SRC
- name: Use the local Apt package cache.
become: yes
copy:
- content: |
- Acquire::http::Proxy "http://apt-cacher.{{ domain_priv }}.:3142";
+ content: >
+ Acquire::http::Proxy
+ "http://apt-cacher.{{ domain_priv }}.:3142";
dest: /etc/apt/apt.conf.d/01proxy
mode: u=rw,g=r,o=r
#+END_SRC
Afterwards any re-configuration should use the following command.
#+BEGIN_SRC sh
-tv_grab_zz_sdjson --configure --config-file ~/.mythtv/Mr.Antenna.xmltv
+tv_grab_zz_sdjson --configure \
+ --config-file ~/.mythtv/Mr.Antenna.xmltv
#+END_SRC
Here is a transcript of a session with ~tv_grab_zz_sdjson~. Note that
program as user ~mythtv~.
#+BEGIN_SRC sh
-tv_grab_zz_sdjson --configure --config-file ~/.mythtv/Mr.Antenna.xmltv
+tv_grab_zz_sdjson --configure \
+ --config-file ~/.mythtv/Mr.Antenna.xmltv
#+END_SRC
The program will prompt for the zip code and offer a list of "inputs"
#+CAPTION: =abbey=
#+BEGIN_SRC perl :tangle abbey
-die
- "usage: $0 [config,new,old,pass,client,upgrade,reboots,versions]\n";
+my $ops = "config,new,old,pass,client,upgrade,reboots,versions";
+die "usage: $0 [$ops]\n";
#+END_SRC
echo ""
print_usage
echo ""
- echo "This plugin checks hardware status using the lm_sensors package."
+ echo "This plugin checks hardware status using" \
+ "the lm_sensors package."
echo ""
support
exit $STATE_OK
brief_data() {
echo "$1" | sed -n -E -e '
- /^temp[0-9]+: +[-+][0-9.]+.?C/ { s/^temp[0-9]+: +([-+][0-9.]+).?C.*/ \1/; H }
+ /^temp[0-9]+: +[-+][0-9.]+.?C/ {
+ s/^temp[0-9]+: +([-+][0-9.]+).?C.*/ \1/; H }
$ { x; s/\n//g; p }'
}
case "$1" in
- --help)
- print_help
- exit $STATE_OK
- ;;
- -h)
- print_help
- exit $STATE_OK
- ;;
- --version)
- print_revision $PROGNAME $REVISION
- exit $STATE_OK
- ;;
- -V)
- print_revision $PROGNAME $REVISION
- exit $STATE_OK
- ;;
- *)
- sensordata=`sensors 2>&1`
- status=$?
- if test ${status} -eq 127; then
- text="SENSORS UNKNOWN - command not found"
- text="$text (did you install lmsensors?)"
- exit=$STATE_UNKNOWN
- elif test ${status} -ne 0; then
- text="WARNING - sensors returned state $status"
- exit=$STATE_WARNING
- elif echo ${sensordata} | egrep ALARM > /dev/null; then
- text="SENSOR CRITICAL -`brief_data "${sensordata}"`"
- exit=$STATE_CRITICAL
- elif echo ${sensordata} | egrep FAULT > /dev/null \
- && test "$1" != "-i" -a "$1" != "--ignore-fault"; then
- text="SENSOR UNKNOWN - Sensor reported fault"
- exit=$STATE_UNKNOWN
- else
- text="SENSORS OK -`brief_data "${sensordata}"`"
- exit=$STATE_OK
- fi
+--help)
+ print_help
+ exit $STATE_OK
+ ;;
+-h)
+ print_help
+ exit $STATE_OK
+ ;;
+--version)
+ print_revision $PROGNAME $REVISION
+ exit $STATE_OK
+ ;;
+-V)
+ print_revision $PROGNAME $REVISION
+ exit $STATE_OK
+ ;;
+*)
+ sensordata=`sensors 2>&1`
+ status=$?
+ if test ${status} -eq 127; then
+ text="SENSORS UNKNOWN - command not found"
+ text="$text (did you install lmsensors?)"
+ exit=$STATE_UNKNOWN
+ elif test ${status} -ne 0; then
+ text="WARNING - sensors returned state $status"
+ exit=$STATE_WARNING
+ elif echo ${sensordata} | egrep ALARM > /dev/null; then
+ text="SENSOR CRITICAL -`brief_data "${sensordata}"`"
+ exit=$STATE_CRITICAL
+ elif echo ${sensordata} | egrep FAULT > /dev/null \
+ && test "$1" != "-i" -a "$1" != "--ignore-fault"; then
+ text="SENSOR UNKNOWN - Sensor reported fault"
+ exit=$STATE_UNKNOWN
+ else
+ text="SENSORS OK -`brief_data "${sensordata}"`"
+ exit=$STATE_OK
+ fi
- echo "$text"
- if test "$1" = "-v" -o "$1" = "--verbose"; then
- echo ${sensordata}
- fi
- exit $exit
- ;;
+ echo "$text"
+ if test "$1" = "-v" -o "$1" = "--verbose"; then
+ echo ${sensordata}
+ fi
+ exit $exit
+ ;;
esac