mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-24 09:57:09 +00:00
Whitespace cleanup
* remove trailing whitespace * remove empty lines at the end of files
This commit is contained in:
parent
ef851f0c34
commit
17f784270a
604 changed files with 2927 additions and 2945 deletions
|
@ -15,11 +15,11 @@ get_data (){
|
|||
|
||||
do_stats () {
|
||||
count=1
|
||||
for I in `get_data`; do
|
||||
[ $count = 3 ] && echo "countb.value $I"
|
||||
[ $count = 6 ] && echo "county.value $I"
|
||||
[ $count = 9 ] && echo "countc.value $I"
|
||||
[ $count = 12 ] && echo "countm.value $I"
|
||||
for I in `get_data`; do
|
||||
[ $count = 3 ] && echo "countb.value $I"
|
||||
[ $count = 6 ] && echo "county.value $I"
|
||||
[ $count = 9 ] && echo "countc.value $I"
|
||||
[ $count = 12 ] && echo "countm.value $I"
|
||||
count=$(($count + 1))
|
||||
done
|
||||
|
||||
|
@ -33,7 +33,7 @@ graph_title HP 2600 pages by cartridge statistics
|
|||
graph_vlabel Count (Pages)
|
||||
graph_category printing
|
||||
graph_info Pages count by color.
|
||||
graph_args -l 0
|
||||
graph_args -l 0
|
||||
graph_scale no
|
||||
line.label ---
|
||||
line.line 0
|
||||
|
|
|
@ -15,11 +15,11 @@ get_data (){
|
|||
|
||||
do_stats () {
|
||||
count=1
|
||||
for I in `get_data`; do
|
||||
[ $count = 1 ] && echo "statb.value $I"
|
||||
[ $count = 4 ] && echo "staty.value $I"
|
||||
[ $count = 7 ] && echo "statc.value $I"
|
||||
[ $count = 10 ] && echo "statm.value $I"
|
||||
for I in `get_data`; do
|
||||
[ $count = 1 ] && echo "statb.value $I"
|
||||
[ $count = 4 ] && echo "staty.value $I"
|
||||
[ $count = 7 ] && echo "statc.value $I"
|
||||
[ $count = 10 ] && echo "statm.value $I"
|
||||
count=$(($count + 1))
|
||||
done
|
||||
|
||||
|
@ -29,11 +29,11 @@ case $1 in
|
|||
config)
|
||||
cat <<'EOF'
|
||||
host_name printers
|
||||
graph_title HP 2600 cartridge status
|
||||
graph_title HP 2600 cartridge status
|
||||
graph_vlabel Status (%)
|
||||
graph_category printing
|
||||
graph_info Toner status.
|
||||
graph_args --upper-limit 400 -l 0
|
||||
graph_args --upper-limit 400 -l 0
|
||||
line.label ---
|
||||
line.line 400
|
||||
statb.label Black
|
||||
|
|
|
@ -140,7 +140,7 @@ tray3.min 0
|
|||
tray3.max 100
|
||||
";
|
||||
}
|
||||
|
||||
|
||||
print "multigraph hpclj_pagecount
|
||||
graph_category printing
|
||||
graph_title HP Printer Page Counters
|
||||
|
@ -182,11 +182,11 @@ sub printPercentageValue {
|
|||
my $field = $_[0];
|
||||
my $oid_cur = $_[1];
|
||||
my $oid_max = $_[2];
|
||||
|
||||
|
||||
if(not oidExists($oid_cur) || not oidExists($oid_max)){
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
my $val_max = $session->get_single($oid_max) || 'U';
|
||||
my $val_cur = $session->get_single($oid_cur);
|
||||
if ($val_max ne 'U') {
|
||||
|
@ -199,11 +199,11 @@ sub printValue {
|
|||
}
|
||||
my $field = $_[0];
|
||||
my $oid = $_[1];
|
||||
|
||||
|
||||
if(not oidExists($oid)){
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
my $val_cur = $session->get_single($oid) || 'U';
|
||||
if ($val_cur ne 'U') {
|
||||
print $field, ".value ", $val_cur, "\n";
|
||||
|
@ -215,7 +215,7 @@ sub oidExists {
|
|||
}
|
||||
my $oid = $_[0];
|
||||
my $val = $session->get_single($oid);
|
||||
|
||||
|
||||
if(!length $val || $val eq 'noSuchInstance' || $val eq 'U'){
|
||||
return(0);
|
||||
}else{
|
||||
|
|
|
@ -27,7 +27,7 @@ As is.
|
|||
|
||||
#%# family=contrib
|
||||
#%# capabilities=autoconf
|
||||
|
||||
|
||||
=cut
|
||||
|
||||
case $1 in
|
||||
|
@ -51,7 +51,7 @@ esac
|
|||
wget -q -o /dev/null -O $TMP_DIR/$PRINTER_IP-Supplies.html http://$PRINTER_IP/status/Supplies.html
|
||||
|
||||
|
||||
TONER_STR=$(grep "<td width=5%>" "$TMP_DIR/$PRINTER_IP-Supplies.html")
|
||||
TONER_STR=$(grep "<td width=5%>" "$TMP_DIR/$PRINTER_IP-Supplies.html")
|
||||
#<td width=5%>99%</td>
|
||||
|
||||
echo -n "black.value "
|
||||
|
@ -59,4 +59,4 @@ echo $TONER_STR | egrep -o "5%>[0-9]{1,2}" | egrep -o "[0-9]{1,2}$"
|
|||
|
||||
|
||||
rm $TMP_DIR/$PRINTER_IP-Supplies.html
|
||||
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ As is.
|
|||
|
||||
#%# family=contrib
|
||||
#%# capabilities=autoconf
|
||||
|
||||
|
||||
=cut
|
||||
|
||||
case $1 in
|
||||
|
@ -84,10 +84,10 @@ wget -q -o /dev/null -O $TMP_DIR/$PRINTER_IP-stsply.htm http://$PRINTER_IP/stspl
|
|||
|
||||
#toner and drum cartriges have both status and percentage
|
||||
|
||||
TONER_STR=$(grep Toner "$TMP_DIR/$PRINTER_IP-stsply.htm")
|
||||
TONER_STR=$(grep Toner "$TMP_DIR/$PRINTER_IP-stsply.htm")
|
||||
#info=info.concat([['Toner Cartridges',[['Cyan Toner [C]',0,77],['Magenta Toner [M]',7,1],['Yellow Toner [Y]',7,1],['Black Toner [K]',0,39]],3]]);
|
||||
|
||||
DRUM_STR=$(grep Drum "$TMP_DIR/$PRINTER_IP-stsply.htm")
|
||||
DRUM_STR=$(grep Drum "$TMP_DIR/$PRINTER_IP-stsply.htm")
|
||||
#info=info.concat([['Drum Cartridges',[['Drum Cartridges',0,79]],1]]);
|
||||
|
||||
echo -n "cyan.value "
|
||||
|
@ -106,4 +106,4 @@ echo -n "drum.value "
|
|||
echo $DRUM_STR | egrep -o "s',[0-9],[0-9]{1,2}" | egrep -o "[0-9]{1,2}$"
|
||||
|
||||
rm $TMP_DIR/$PRINTER_IP-stsply.htm
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue