Hi, Moin
Ich suche noch nach einem geeigneten Platz für meine Scripte die ich der allgm. zur Verfügung stellen möchte, finde aber ausser github nicht wirklich den geeigneten Ort hier richtig!? Zum Wiki habe ich keinen Zugang.
Und da dieses munin plugin losgelöst von den anderen Dingen die ich gerade schreibe ist, stelle ich es hier zur Verfügung!
Beim munin project gibt es auch noch ein interessantes plugin neben hier zu lesenden Ideen!... Wer aber munin kennt und nicht die C Variante nimmt hat keine Freude an der performance daher wird dieses plugin das einzige sein was ich verwenden will Eine einfache Ampel grün und rot für an oder aus.
Bash
#!/bin/sh
# -*- sh -*-
: << =cut
=head1 NAME
VDR uptime - Plugin for munin to measure vdr's uptime.
=head1 NOTES
Checks an exit code of a vdr process to check if its running or not and to see if vdr is up or not.
Where a green graph means it's up and a red one to show you thats down
Especially made for a upcoming sleep wakeup program with some futher stats in a second plugin.
See also the vdr plugin at munun website if you are interessted in more stuff.
=head1 AUTHOR
Contributed for VDR project by Florian Blasel
=head1 LICENSE
* @license BSD License V2
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS “AS IS” AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=head1 MAGIC MARKERS
#%# family=auto
#%# capabilities=autoconf
=cut
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
if [ "$1" = "config" ]; then
echo 'graph_title VDR Uptime'
echo 'graph_args --base 1000 --lower-limit 0 '
echo 'graph_scale no'
echo 'graph_vlabel Uptime / Downtime'
echo 'graph_category vdr'
echo 'uptime.label Uptime'
echo 'uptime.draw AREA'
echo 'downtime.label Downtime'
echo 'downtime.colour FF0000'
echo 'downtime.draw AREA'
exit 0
fi
down=`svdrpsend -d localhost checkSleepWakeupCtl | command grep checkSleepWakeupCtl | echo $?`;
if [ $down = 0 ]; then up=1;down=0; else up=0;down=1; fi
printf "uptime.value ${up}\n";
printf "downtime.value ${down}\n";
Alles anzeigen