

Bot for power monitoring of the HPCAC SCC of the ISC events. It can show current and peak power values, sends notifications in case of a team exceeds the power limit and can reset the actual peak power values on certain PDUs.
Version: 1.6
For running the Bot, no installation is necessary.
Just clone this repository using git clone https://github.com/hpcac/ISCBot.git
.
Additional requirements are:
- Net-SNMP
- ELinks
- Python3
- Pexpect
- python-telegram-bot including the JobQueue requirement
There are two configurable files in the ISCBot directory that one has to customize.
accesslist.conf
This file contains all user chat_id`s that going to have access to the reset functions. If the first `chat_id is a group_id, all members of this group have access to the functions. Comment lines can be inserted via '
#
'. Example access list:# ACCESS LIST FOR THE CHAT_IDs FOR ALL GROUP MEMBER -123456789 # <-- This is our group_id 424242424 # <-- chat_id of users which are allowed 133742241 # to communicate in private chats
If you do not know the
chat_id
for a certain user, the ID will be shown as terminal output of the host while the user is trying to access a restricted function. You then can copy thechat_id
to your access list.ips.csv
This file contains all PDUs for monitoring and resetting. Each line shows the last 3 digits of the ip address of the specific PDU, its unique name, and the name of the associated team. Only lines in form of IP,PDU_NAME,TEAM_NAME are allowed. Example (let's say we have 3 PDUs in the range of 192.168.1.101 to 192.168.1.103):
101, Name_of_PDU, Team-Sunshine 102, Second_PDU, Team-Sunshine 103, Something completely different, Team-PurpleRain
As the host of the bot, just type ./iscbot.py
in the ISCBot/iscbot
directory to initialize the bot.
You will get asked for the password for the PDU super user to be able to reset the peak power values.
As a client, you can either communicate with the bot in a group or a single chat. Mind that in a group
the ISCBot is only able to listen to commands starting with '/
'.
If you never interacted with the bot before, search in the Telegram search field for
@ISC_PDU_Bot
and type /start
for starting a conversation.
/current
- Sends a list of the current power usage for each team.
/peaks
- Sends a list of the peak power for each team.
/peakdates
- Sends a list of the peak power with corresponding timestamp for each team.
/reset
@restricted
Resets PDU's peak power value specified by a given IP. After starting the command you must choose the team for which you want to reset all correspnding PDUs. This process takes some time, be patient :).
/help
- Prints out help.
In the background the bot checks every 2 seconds for a team exceeding the power limit.
If so, the peak power value, the PDU name and a timestamp will be send via message to a specific group of users.
We propose either to send push notifications to the assigned group or to all users included in the access list.
Both variants are implement in the source code, by default the bot sends the notification to all access list users.
Additionally, all limit exceedings will be logged in the file exceedings.log
.
Implementation: Jan Laukemann
Images
- ISC logo: © 2018 Prometeus GmbH
- HPCAC logo: © 2018 HPC Advisory Council