Nagios – Monitoring an MGE UPS

If we have a UPS or a UPS in our organization, why not monitor it? Why not know the status of your batteries? If we have any problem that is surely critical, I think it is reasonable to centralize and control it from our Nagios or Centreon machine in order to have any problem we may have under control and receive its notifications. So if you are interested in knowing the status of your UPS, take a look at this document!

 

In this post we will monitor a somewhat old UPS from MGE (which after being from APC must now belong to Schneider Electric), We'll use a couple of scripts, with one we will get a lot of information and with the second the general status of the UPS. The first 'check_snmp_mgeeaton_ups.pl script’ that we can download from: https://exchange.nagios.org/directory/Plugins/Hardware/UPS/Merlin-Guerin/check_snmp_mgeeaton_ups/details. The second script 'check_snmp_mge_ups’ We took it down from: https://exchange.nagios.org/directory/Plugins/Network-Protocols/SNMP/MGE-check_mge_ups/details. We will have to leave them in the plugins folder of our Nagios or Centreon and make them executable with 'chmod +x'.

 

 

Before you go any further, Remember to enable SNMP on the UPS, introducing an SNMP Community and allowing connections from the Nagios machine / Centreon!

 

 

With 'check_snmp_mgeeaton_ups.pl’ we will be able to obtain a lot of information from a UPS, both at the battery level, Load failures, Voltage, Measure the outgoing load or its voltage, Temperatures, etc… What we see in aid, Let's go! If we want to try it, Run

[SourceCode]./check_snmp_mgeeaton_ups.pl -H DIRECCION_IP_SAI -C COMUNIDAD_SNMP -OR OPTION[/SourceCode]

 

 

GOOD, the first thing will be to register the UPS Host in Centreon, which will be associated with the Services that will monitor you. Since “Configuration” > “Hosts” > “Add…” we add the UPS:

  • Name: Name of UPS to monitor.
  • Alias: Name with which we will see the UPS in our Centreon.
  • IP Address / DNS: We indicate the IP address of the UPS.
  • SNMP Community & Version: We indicate the SNMP community and its version.
  • Template: If we have the Centreon plugin pack installed, we can use an interesting base template called 'HW-UPS-Standard-Rfc12628-SNMP-custom, If you want to install them, Check out This document. And if not, Usually it will be 'generic-host'.

 

We keep with “Save”,

 

We created the Command for this script and what we will need for each Service we will monitor, As we already know from “Configuration” > “Commands” > “Add” and something like:

  • Command Name: Specify the name of the command, As I usually tell you, I usually use the name of the script to locate it as quickly as possible if necessary, in this case 'check_snmp_mgeeaton_ups.pl'.
  • Command Type: We mark 'Check'.
  • Command Line: We enter what this command will execute, in the example that concerns us: '/usr/lib/nagios/plugins/check_snmp_mgeeaton_ups.pl -H $HOSTADDRESS$ -C $_HOSTSNMPCOMMUNITY$ -O $ARG 1$'
  • Argument Description: Click on 'Describe arguments' and define the only argument we have, which will be the Option that we will want to check when creating the Services

 

We record with “Save”,

 

 

And nothing, now we create each Service that will monitor each item, In this example, to monitor the charge of the batteries we will have to configure a new service, and so on with each element to be checked! We create the Services from “Configuration” > “Services” > “Add…” and we complete:

  • Description: It will be the name of the service with which we will see in the monitoring, Battery charging, Output Voltage…
  • Linked with Hosts: We associate it with the newly created UPS Host.
  • Template: We indicate the parent template from which you will inherit certain settings, if we did it on that template, as always when the usual thing is to modify notifications, Periods, Contacts, etc... Usually it will be the 'generic-active-service-custom'.
  • Check Command: Select the command we just created in the previous step, 'check_snmp_mgeeaton_ups.pl'.
  • Args: When we select this command, we will get the arguments to fill in, We remember from the help we saw in the shell the option that we should indicate, battery_level, output_voltage…

 

We record with “Save”,

 

Let's go with the second script! With this one like I said before, we will obtain the general condition of the UPS, A summary of your health by getting the values of all your sensors. From the Nagios shell we would run to test if we want to.:

[SourceCode]./check_snmp_mge_ups -H DIRECCION_IP_UPS -C COMUNIDAD_SNMP[/SourceCode]

 

We create the Command for this second script, as before, since “Configuration” > “Commands” > “Add” and something like:

  • Command Name: 'check_snmp_mge_ups'.
  • Command Type: We mark 'Check'.
  • Command Line: We enter what this command will execute, in the example that concerns us: '/usr/lib/nagios/plugins/check_snmp_mge_ups -H $HOSTADDRESS$ -C $_HOSTSNMPCOMMUNITY$'

 

We record with “Save”,

 

We created the Service that will check your health from “Configuration” > “Services” > “Add…” and we complete:

  • Description: Status, for example, gives it an ideal name to know what this Service brings us
  • Linked with Hosts: We associate it with the UPS Host.
  • Template: The parent template from which you will inherit certain settings, Usually 'generic-active-service-custom'.
  • Check Command: Select the newly created Command in the previous step, 'check_snmp_mge_ups'.

 

We record with “Save”,

 

And that's it!! If we go to the “Monitoring” we will now be able to visualize the monitoring status of our UPS, we will be able to collect really useful information apart from controlling its condition perfectly. Remember to export the data and reload the settings so that Centreon can read the changes. If you need to remember, from "Configuration" > "Pollers" > "Export configuration", Selecting our poller, We mark the checks and restart & "Export".

Si queremos forzar el checkeo, ya sabemos, select the services that interest us and in the combo select 'Services – Schedule immediate check (Forced)’.

I hope it helps you!

 

Recommended Posts

Author

nheobug@bujarra.com
Autor del blog Bujarra.com Cualquier necesidad que tengas, Do not hesitate to contact me, I will try to help you whenever I can, Sharing is living ;) . Enjoy documents!!!

Using Citrix Optimizer

26 June de 2018