Giter VIP home page Giter VIP logo

check_ups_status.pl's Introduction

This might have issues with any generic ups as I was unable to fully test but it has been tested on Vertiv RDU101xx and Unity-DP cards along with Tripplite WEBCARDLX.

check_ups_vertiv.pl

Icinga2 Vertiv UPS Check

    -h      Help
    -V      Version
    -C      SNMP Community
    -H      Hostname
    -p      SNMP Port (Default: 161)
    -t      SNMP Timeout (Default 5 sec)
    -v      SNMP Version [2|3]  (Default: 2)
    -a      Alarm Output Format [1=count|2=short|3=long]  (Default: Long)
            1 = Alarm Count / Load Information
            2 = Alarm Count / Load Information (Details on Multiline)
            3 = Alarm Count & Details (May overrun line)
    -b      Battery Self Test (Vertiv GXT5 ONLY) [1|2|3|4]  (Default: 3)
            1 = Ignore In Progress (Message Displayed/Okay Status)
            2 = Ignore In Progress (Nothing Displayed/Okay Status)
            3 = Warn for In Progress and on Battery
            4 = Crit for In Progress and on Battery
    -d      Display Output Format [l|s|h|t|b] (Default: lshtb, Order Changes Displayed Order)*
            l = Show Load Information
            s = Show Status of Battery and Output
            h = Show Battery Last Replaced Date and Health (Vertiv GXT5 Only)
            t = Show Time Remaining and Charge %
            b = Show Brownouts & Blackouts
            * First Option is Line 1 output (Alarms Override, See -a)
    -z      DON'T Print exit status on Line 1 (Hate duplication)
    --un    SNMPv3 Username
    --sl    SNMPv3 Security Level [noauthnopriv|authnopriv|authpriv] (Default: noauthnopriv)
    --ap    SNMPv3 Auth Protocol [md5|sha] (Default: sha)
    --ak    SNMPv3 Auth Password
    --pp    SNMPv3 Privacy Protocol [des|aes] (Default: aes)
    --pk    SNMPv3 Privacy Password
    --wc    WARN: On Remaining % of Battery Charge (Default: 10%)
    --cc    CRIT: On Remaining % of Battery Charge (Default:  5%)
    --wl    WARN: On Percent of Battery Load (Integer) (Default: 80%)
    --cl    CRIT: On Percent of Battery Load (Integer) (Default: 90%)
    --wt    WARN: On Minutes of Battery Remaining (Default: 2 min)
    --ct    CRIT: On Minutes of Battery Remaining (Default: 1 min)
    --ws    WARN: On Battery Status: (1=Normal, 2=Unknown, 3=Low, 4=Depleted)
    --cs    CRIT: On Battery Status: (1=Normal, 2=Unknown, 3=Low, 4=Depleted)

 Example: ./check_ups_status.pl -C public -H 193.168.3.30 -ws 3 -cs 4
Example GXT5 Output:

image

Example Tripplite Output:

image

check_ups_status.pl's People

Contributors

bmccorkle avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

check_ups_status.pl's Issues

No usefull error message in case of SNMP failure

Hi,
when SNMP communication does not work with the Vertiv controller there is no really useful error message. Its just the typical perl gibberish of not defined variables. Would be nice to eliminate the perl error messages and print an CRITICAL No SNMP response.


Use of uninitialized value in string eq at /usr/local/lib/nagios/plugins/check_ups_status.pl line 653.
Use of uninitialized value in string eq at /usr/local/lib/nagios/plugins/check_ups_status.pl line 703.
Use of uninitialized value in string eq at /usr/local/lib/nagios/plugins/check_ups_status.pl line 732.
Use of uninitialized value in string eq at /usr/local/lib/nagios/plugins/check_ups_status.pl line 747.
Use of uninitialized value in numeric ne (!=) at /usr/local/lib/nagios/plugins/check_ups_status.pl line 758.
Use of uninitialized value in string eq at /usr/local/lib/nagios/plugins/check_ups_status.pl line 779.
Use of uninitialized value in string eq at /usr/local/lib/nagios/plugins/check_ups_status.pl line 794.
Use of uninitialized value in string eq at /usr/local/lib/nagios/plugins/check_ups_status.pl line 824.
Use of uninitialized value in numeric eq (==) at /usr/local/lib/nagios/plugins/check_ups_status.pl line 851.
Use of uninitialized value in numeric eq (==) at /usr/local/lib/nagios/plugins/check_ups_status.pl line 855.
Use of uninitialized value in numeric eq (==) at /usr/local/lib/nagios/plugins/check_ups_status.pl line 858.
Use of uninitialized value in numeric eq (==) at /usr/local/lib/nagios/plugins/check_ups_status.pl line 862.
Use of uninitialized value in numeric eq (==) at /usr/local/lib/nagios/plugins/check_ups_status.pl line 868.
Use of uninitialized value in numeric eq (==) at /usr/local/lib/nagios/plugins/check_ups_status.pl line 872.
Use of uninitialized value in numeric eq (==) at /usr/local/lib/nagios/plugins/check_ups_status.pl line 876.
Use of uninitialized value in numeric eq (==) at /usr/local/lib/nagios/plugins/check_ups_status.pl line 879.
Use of uninitialized value in numeric eq (==) at /usr/local/lib/nagios/plugins/check_ups_status.pl line 883.
Use of uninitialized value in numeric eq (==) at /usr/local/lib/nagios/plugins/check_ups_status.pl line 887.
Use of uninitialized value in numeric eq (==) at /usr/local/lib/nagios/plugins/check_ups_status.pl line 891.
Use of uninitialized value $load_percent in numeric ge (>=) at /usr/local/lib/nagios/plugins/check_ups_status.pl line 910.
Use of uninitialized value $load_percent in numeric ge (>=) at /usr/local/lib/nagios/plugins/check_ups_status.pl line 918.
Use of uninitialized value $charge_remain in numeric le (<=) at /usr/local/lib/nagios/plugins/check_ups_status.pl line 946.
Use of uninitialized value in numeric ne (!=) at /usr/local/lib/nagios/plugins/check_ups_status.pl line 1327.
Use of uninitialized value in string eq at /usr/local/lib/nagios/plugins/check_ups_status.pl line 1256.


CRITICAL - |

Does not work on Vertiv GXT4-10000RT230

Hi,
trying this on a GXT4 as in the Subject i only get a log of perl failures:

Use of uninitialized value $hash_battery{"snmp_battery_alarm_count"} in hash element at /usr/local/lib/nagios/plugins/check_ups_status.pl line 736.
Use of uninitialized value in numeric ne (!=) at /usr/local/lib/nagios/plugins/check_ups_status.pl line 736.
Use of uninitialized value $hash_config{"snmp_config_max_va"} in hash element at /usr/local/lib/nagios/plugins/check_ups_status.pl line 796.
Use of uninitialized value $hash_vertiv{"snmp_vertiv_output_appar_pwr"} in hash element at /usr/local/lib/nagios/plugins/check_ups_status.pl line 799.
Use of uninitialized value in int at /usr/local/lib/nagios/plugins/check_ups_status.pl line 799.
Use of uninitialized value $va_capacity in division (/) at /usr/local/lib/nagios/plugins/check_ups_status.pl line 802.
Illegal division by zero at /usr/local/lib/nagios/plugins/check_ups_status.pl line 802.

Seeing from strace SNMP communication works. A bunch of GXT5 work flawlessly.

Thanks

Flo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.