Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UTF8 fixes + support for CS131 #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions check_ups_snmp.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash

# plugin creado por Daniel Due�as
# plugin creado por Daniel Dueñas
# Plugin para chequeo a traves de snmp de la tarjeta cs121 y otras tarjetas para ups

# plugin developed by Daniel Due�as
# plugin developed by Daniel Dueñas
# This plugin can check a sai with cs121 and other adapters by snmp.

# This program is free software; you can redistribute it and/or modify
Expand All @@ -28,7 +28,7 @@

PROGNAME=`basename $0`
VERSION="Version 1.0,"
AUTHOR="2013, Daniel Due�as Domingo (mail:[email protected])"
AUTHOR="2013, Daniel Dueñas Domingo (mail:[email protected])"

print_version() {
echo "$VERSION $AUTHOR"
Expand Down Expand Up @@ -182,7 +182,7 @@ alarm(){
temperature(){
val=`getsnmp $1`
f_error $?
output="battery temperature = "$val"C"
output="battery temperature = "$val"°C"
perfdata="'temperature'=$val;$2;$3"
if test $val -gt $3
then state=$ST_CR
Expand All @@ -206,6 +206,11 @@ output_load(){
do
oid="$1.$counter"
percentload[$counter]=`getsnmp $oid`
# CS131 FIX. they use $oid.0 for storing the value
if test ${percentload[$counter]} == 'Such'
then
percentload[$counter]=`getsnmp $oid.0`
fi
counter=`expr $counter + 1`
done
output="Percent Load of $numlines lines:"
Expand Down Expand Up @@ -250,6 +255,11 @@ input_voltage(){
do
oid="$1.$counter"
voltage[$counter]=`getsnmp $oid`
# CS131 FIX. They use $oid.0 for storing the value
if ${voltage[$counter]} == 'Such'
then
voltage[$counter]=`getsnmp $oid.0`
fi
f_error $?
counter=`expr $counter + 1`
done
Expand Down