Automation Example of System Administrator Tasks in a Server Room on the Basis of Zabbix and NetPing

  • Published In: Tutorial
  • Created Date: 2017-09-10
  • Hits: 1399

Technical requirements for server rooms are determined by the building code 11-2-80 for buildings of "B" category, and the "Instruction on designing buildings and rooms for electronic computing machines SN 512-78".

In the section of micro-climate and noise requirements, the next is indicated:

#
Parameter
Value
1Temperature
20°C±2°C no more than 25°C. For a bigger lifetime of the server equipment, a bottom threshold is better
2Relative air humidity
20-70% (no more than 75% during a cold season, no more than 65% during a warm season for the temperatures over 25°C, no more than 70% for temperatures below 24°C)
3Optimal air velocity
0,2 meters per second (no more than 0,3 meters per second for a cold season, 0,5 meters per second for a warm season)
4Air dustiness
0,75 mg/m3, with size of particles of no more than 3 micrometers
5Permissible noise level
No more than 65 dB

The access to server rooms is limited. The staff appears in server rooms only when installing new equipment and for conducting planned maintenance or repair. Therefore, it is important to organize a monitoring system for server rooms.

The monitoring system should include sensors (of temperature, humidity, smoke, leakage, etc.), and a system for controlling, notifying and recording the events.

Let's consider the features of the integration of UniPing server solution v4/SMS and Zabbix.

Automatic Controlling a Backup Air Conditioner

To provide necessary requirements for the micro-climate and humidity, a server room is equipped by conditioning and ventilation systems. Depending on the budget, it can be precision systems or cheaper ceiling systems, or split air conditioners.

When choosing an air conditioner for a server room, BTU (British Thermal Unit) is often used. Heat release in BTU is used in technical specifications for server and communication equipment. The value of the heat release can be calculted into the power 1kW = 3412 BTU/h.

To ensure the flawless operation and timely technical maintanance, there is a need to reserve 100% of conditioning systems.

To increase the lifetime of the equipment, it is possible to switch roles of the main and backup conditioners.

A backup conditioner must provide the replacement of the main one if the main conditioner failed or needs technical maintanance. If the efficiency of conditioning is decreased, it is possible to use a backup conditioner together with the main one.

Let's imagine that we have a task to automatically control a backup air conditioner, switch it on when t > 28°C and switch it off when t < 22°C. A backup conditioner is controlled by an IR remote control.

To implement this, there is a need to fulfill the next operations:

  1. Plug in IRC-TR v2 (IR extension module) to UniPing server solution v4/SMS
  2. Record commands from the IR remote of the conditioner into the cells of the module IRC-TR v2 (IR extension module)
  3. Plug in a temperature sensor to UniPing server solution v4/SMS
  4. On the page Logic, there is a need to specify rules for switching on an air conditioner and switching it off

Let's examine each step in details:

  1. IRC-TR v2 (IR extension module) is plugged to UniPing server solution v4/SMS to the terminal block Thermo/IR. A connection is made by a 4-wired cable. A maximum length of the cable is 10 meters. The IR module is powered from the jack. A connection scheme can be found in the user guide.

Thermo IR terminal block

2. The IR module is equipped by the nonvolatile memory, where it can save up to 16 IR commands from different devices. For our case, there is a need to record two commands for switching an air conditioner on and switching it off. To record commands, there is a need to go to the page "IR Commands" of a web interface.

IR Command Recording

Before recording commands, there is a need to place the IR module and the remote control one next to another on a distance of 10-30 sm. Click the button "Start Recording" and click the button on the IR remote during 30 seconds. Then, specify a cell number, where to record the command, a memo for it, and save.

Then, check that commands are recorded properly, and an air conditiner is switched on and off using the IR module. To do this, there are buttons "Play" on the page.

 3. Plug a temperature sensor to a UniPing server solution v4/SMS.

It is possible to plug up to 8 1-wire (THS) temperature sensors. 1-Wire temperature sensors are plugged to a device in 1W jacks using the RJ-12 connector. When plugging a sensor to a device, there is a need to indicate a unique ID number of a sensor. An ID of a sensor can be determined from the page "1-WIRE" of a web interface. Detailed information is given in the firmware description.

On the page "Temperature Sensors" of a device web interface, it is possible to specify a memo, a bottom and top thresholds of the normal operation of a temperature sensor. In addition, notifications about changing a status of sensors are configured on this page. 

Configuring a top and bottom threshold for a normal operation of a temperature sensor

In the window for configuring notifications, it is possible to choose events, within which a notification will be sent and sending methods, such as: recording into a log of a device, recording to Syslog, sending notifications via e-mail, using SMS messages, sending SNMP Trap.

To configure parameters of sending SMS messages, a page "SMS" of a web interface is used. To configure sending e-mail notifications, a page "E-mail" of a web interface is used. To configure recording to Syslog, and sending SNMP Trap, a page "Setup" is used.

Notifications for a temperature sensor

In addition, it is possible to use automation methods webhook. The example of using webhook is given in the article

4. On the page "Logic" of a web interface of UniPing server solution v4/SMS, specify controlling rules.

The first rule insures switching an air conditioner on when a threshold temperature configured in a thermostat is exceeded.

The second rule switches an air conditioner off when a temperature decreases.

Configuring a controlling logic for an air conditioner

Values of thresholds of thermostats are specified on the page "Logic". To minimize a frequency of triggering caused by small fluctuations of temperature or humidity, a parameter "Hysteresis" is used near the threshold.

Configuring a hysteresis for switching an air conditioner

5. We will use the system Zabbix to record events of changing a temperature in a server room, . 

Temperature graph of a server room

So what do we have as a result? When a temperature is increased up to 28°C, an additional air conditioner will be switched on and it will cool a server room. When a temperature is decreased, an additional air conditioner will be switched off. If a temperature does not exceed 40°C, we will not even receive any notification about it. The information about a temperature change will be recorded into the Zabbix database. If these measures are not enough, and temperature in a server room continues to rise, then a notification will be sent through an email and SMS messages. Depending on the requirements, it is possible to configure sending a notification through Syslog, SNMP TRAP, webhook.

In this example, there is a need to take into account that air conditioners work in several modes – conditioning, ventilation, and heating. Beforehand, a conditioning mode must be set on an air conditioner using a remote control.

Automatic Controlling a Ventilation System

When a ventilation system is organised properly, a cold air arrives from the front of a server cabinet, goes through the equipment and leaves backwards a server cabinet. Namely, the front of a server cabinet is a "cold" zone, and a "hot" zone is backwards.

A fan unit is often used to get rid of the hot air on the top of a rack. This unit may be controlled manually, through a thermo relay, or may be controlled by UniPing server solution v4/SMS.

Let us suppose that the task is the next: switching the ventilation on to blow out a hot air at the temperature t > 28°C, and switching it off at the temperature t < 22°C.

To implement this, there is a need to do the next:

  1. Plug a temperature sensor to UniPing server solution v4/SMS
  2. Plug a fan to a relay. Specify the mode "Logic output" on the page of a relay management
  3. On the page Logic, specify rules for switching a fan on and off

Let us examine each step in details.

  1. Plug a temperature sensor to UniPing server solution v4/SMS.

It is possible to plug up to 8 temperature 1-wire (THS) sensors to a device. 1-wire temperature sensors are connected to a device through 1W jacks using the RJ-12 connector. When connecting a sensor to a device, there is a need to indicate a unique ID of a sensor. An ID of a sensor can be found on the page "1-WIRE" of a web interface. A detailed information is given in the firmware description

On the page "Temperature Sensors" of a device web interface, it is possible to set a memo, a bottom and a top thresholds of the normal operation of a temperature sensor. In addition, notifications about changing a status of sensors are configured on the same page. 

Configuring a bottom and a top threshold of a norm for a temperature sensor

In the window for configuring notifications, it is possible to choose events, at which a notification will be sent, and methods of sending, such as: recording to a log of a device, recording to Syslog, sending notifications via e-mail, using SMS messages, and sending SNMP Trap.

The page "SMS" of a web interface is used to configure parameters of sending SMS messages, the page "E-mail" of a web interface is used to configure sending e-mail notifications, the page "Setup" is used to configure recording to Syslog, and sending SNMP Trap.

Notifications for a temperature sensor

In addition, it is possible to use webhook automation methods. The example of using webhook is given in the article

2. Plug a fan to a relay.

Choose the source of control "Logic" on the page "Relay control" of a web interface and apply changes.

Configuring a relay to plug a fan

3. On the page "Logic" of a web interface, configure rules for switching a fan on and off

The first rule ensures switching a fan on when a threshold temperature specified in a thermostat is exceeded.

The second rule switches a fan off when temperature decreases.

Threshold values of thermostats are set on the page "Logic". To decrease the frequency of triggering caused by small fluctuations of temperature or humidity near the threshold, a parameter "Hysteresis" is used.

Configuring logic of threshold values of thermostats

Configuring a switching hysteresis for thermostats

4. We will  use the Zabbix system to record events of changing temperature in a server room. 

Temperature graph of a server room

Information about switching a relay is gathered in Zabbix as well. As seen from the graph, a relay status is changed. When a relay status is 1, a fan is switched on, when a relay status is 0, a relay is switched off.

Graph of switching a relay

If we combine examples 1 and 2, what we can get as a result? When the temperature rises to 28°C, an exhaust fan and an additional air conditioner will be switched on to cool server equipment. When temperature decreases, an exhaust fan and an additional air conditioner will be switched off. If a temperature does not exceed 40°C, then we will not even receive any notification about it. The information about a temperature change will be recorded to the Zabbix database. If these measures are not enough, and temperature in a server room continues to rise, a notification will be sent through an email and SMS messages. Depending on the requirements, it is possible to configure sending notification through Syslog, SNMP TRAP, webhook.

Emergency Notification

When there is an emergency in a server room, there is a need to notify the staff on duty.

Emergency situations may include triggering of leakage and smoke sensors, deenergizing, rise of the temperature to the critical level, triggering a movement sensor.

To implement this, it is possible to program a protocol of actions that will be performed automatically.

Let us suppose that we need to configure alarm triggering, sending alarm notificaitons at critical temperature rise or triggering a water leakage sensor.

To do this, we need to perform the next actions:

  1. Plug a siren alarm and a water leakage sensor.
  2. Plug a temperature sensor to UniPing server solution v4/SMS.
  3. On the page logic, specify the rules for actions.

Let us examine each step in details.

  1. Connecting a siren alarm and a water leak sensor. A siren alarm is connected to a relay. A connection scheme can be seen on the link. The configurations are set on the page "Relays" of a web interface. We need to indicate a memo and choose "Logic" as a source of control.

Configurations of connecting an alarm to a relay

A water leakage sensor is connected to an IO line. A connection scheme can be seen on the link. In the settings of the page "Discrete IO", there is a need to indicate a mode "Input" for an IO line.

Configuring a connection of a water leakage sensor

In the settings of an IO line, it is possible to indicate a memo for readings of a sensor and the ways to notify about events.

Settings of an IO line

2. Connect a temperature sensor to UniPing server solution v4/SMS. It is possible to plug up to 8 1-wire (THS) temperature sensors to a device. 1-wire temperature sensors are connected to a device through 1W jacks using the RJ-12 connector. When connecting a sensor to a device, there is a need to specify a unique ID of a sensor. An ID of a sensor can be found on the page "1-WIRE" of a web interface. A detailed information is given in the firmware description

On the page "Temperature sensors" of a device web interface, it is possible to configure a memo, a bottom and top thresholds of the normal operation of a temperature sensor. In addition, notifications about changing a status of sensors are configured on the same page. 

Configuring a bottom and a top threshold of the normal operation of a temperature sensor and notifications about changing a status of a sensor

In the window for configuring notifications, it is possible to choose the events, at which a notification will be set as well as sending methods, such as: recording to a log of a device, recording to Syslog, sending notifications via e-mail, using SMS messages, sending SNMP Trap.

To configure parameters of sending SMS messages, a page "SMS" of a web interface is used, the page "E-mail" is used to configure sending e-mail notifications, and the page "Setup" is used to configure recording to Syslog, and sending SNMP Trap.

Notifications for a temperature sensor

In addition, it is possible to use webhook automation methods. An example of using webhook is given in the article

3. On the page "Logic" of a web interface, configure rules for switching an alarm on and off.

Configure a thermostat, indicate a threshold value, reaching which an alarm must be triggered.

Specify the logic rules: if a value of a thermostat exceeds a threshold, there is a need to switch a relay on, and when temperature decreases below the threshold, there is a need to switch a relay off.

Specify in the second pair of rules that if the value of an IO line is 1, there is a need to switch a relay on, and when the value is changed to 0, there is a need to switch a relay off.

Configuring logic rules for switching an alarm on and off

Configuring a hysteresis of switching for a siren alarm

Therefore, it is possible to notify the staff on duty about an emergency using a siren alarm and sending email and SMS notifications.

The information about changing temperature and values of an IO line is saved in the Zabbix database. From the graph it is seen that the value of a line IO1, to which a leakage sensor is connected, can be set to values 1 and 0. The value 1 means there is leakage, while 0 means no leakage.

Graph for a status of a leakage sensor in Zabbix

Automatic Problem Solving Using Zabbix

Probably everyone of you, who use the monitoring system, has a certain group of issues that you know will happen sooner or later, and there is nothing to do about it.

One of variants of automatic reaction to the issue that appears is sending an SMS notification to a system administrator.

Let us consider an automatic sending of SMS from the Zabbix system, with using built-in features of UniPing server solution v4/SMS for sending notifications when the access to a corporate web site is lost.

Let us start the configuration of the monitoring. We imply that you have already preinstalled the Zabbix server. We will use only standard features that are available after the installation.

In this article, I'm configuring the monitoring of our corporate web site http://www.netpingdevice.com.

Adding the web site to the monitoring system is not different from adding any other host. Go to «Configuration -> Hosts» and click «Create host».

Adding a host to monitoring

A standard form opens. Enter the name of the host. Choose any group, (I have "Discovered hosts")

In the field «DNS name», write «netpingdevice.com», choose the field «Connect to» and the value «DNS». Leave everything other on default and click «Save»

Configuring a new host

Now we have to configure the monitoring of the web site. To do this, click the link «Web» next to our new host on the same page with the list of hosts.

Switching on the web site monitoring

In the section of web scenarios, create a new scenario of the test by clicking «Create scenario»

Creating a monitoring scenario

On the first tab «Scenario», fill in the fields: «Name» (a name of a scenario) and «Update Interval» (test interval) The rest can be left default.

configuring a monitoring scenario

Go to the tab «Steps», and click «Add», and fill in a form that opens.

Adding steps for a new scenario

Specify:

«Name» is a name of a scenario step.

«URL» is an address of a web page for the test.

Enter any word or a phrase that is represented on the tested page in the line «Required string». The system will understand if the web site is available according to the presence of this phrase. Let us use the word NetPing for the example.

In the line «Required status code», specify a necessary code of a server response that will indicate that everything is okay – 200.

Configuring a monitoring scenario step

Click «Add». A scenario step is added. Now click «Save» on the page of the scenario to add it to the web site.

The configuration of the monitoring is finished. The results can be seen in a standard way.

Now let us add a trigger that works when a web site is not accessible and automatically sends an SMS notification to a system administrator using a device «UniPing server solution v4/SMS»

I recommend reading the article on the configuration of SMS notifications and performing corresponding settings.

Let us return to the section «Configuration -> Hosts» and click «Triggers» next to our host. 

Enabling trigger mode

The page with a list of triggers opens, click «Create trigger» on the right

Creating a new trigger

Fill in necessary fields and click the button «Add» located next to the «Expression».

Configuring a new trigger

Fill in the form for describing the logic of a trigger.

Form for describing the logic of a trigger

These parameters mean that the trigger will work if the last three tests showed that the value of the parameter web.test.fail is different from 0, which means the accessibility of the web site. Check the data and click «Insert», then click «Save».

The trigger is created.

Now let us create the action of Zabbix in response to the operated trigger that sends the notificaiton via SMS.

Enter «Configuration -> Action», click «Create Action» (a trigger is a source of an event)

Creating a new Zabbix action for the worked trigger

At the tab «Action», configure the next

Configuring a notification for the worked trigger

At the tab «Conditions», set a trigger with the value "Problem" as a condition

Setting a condition for performing the action to the operated trigger

On the tab «Operations», click «New» 

Creating a new step of the action to the operated trigger

and fill in the form that opens according to the example below

Indicating the sending of an SMS message to an administrator about the operated trigger

Operation type – Send Message

In our example, a notification is sent to one user, specified in the field «Send to user», but it is possible to indicate a group of users in the field «Sent to User group».

Send only to – SMS

Click «Add», and then «Save».

The action is created. Now the administrator will receive an SMS notification if a corporate web site is not accessible and will be able to take the necessary actions.

Similarly to this example, you can configure sending SMS notifications on any event that is recorded in Zabbix.


comments powered by Disqus