Bitcoin Forum
June 21, 2024, 08:25:07 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: HOWTO: Monitor your mining rigs with Zabbix  (Read 189 times)
nedfox (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
May 18, 2018, 09:32:45 PM
 #1

Hi all,

This will be an extensive post with follow-ups how you can monitor your mining rigs with Zabbix.

1] If you are familiar with Zabbix, use the template in this post with the notes attached (location of the logfiles)
2] If you are not familiar with Zabbix, the follow-ups will describe howto make a Zabbix server with a Raspberry PI 3 V2, which costs about $35.
3] In a seperate post I'll describe howto use the triggers to actually reboot your miner (with an action), ie. reboot when there's no hash rate output or the hashrate falls below a certain treshold.

I am more then welcome to answer any questions and help ppl out if they have different mining tools; my examples use Awesome miner, but *any*  logs can be used if they supply the values.

I am NOT going to link a ready-to-go Raspberry ISO; I've been thinking of doing this but you cannot trust this in your LAN. Instead I will show you step by step, even if you do not know Linux, how to make your Zabbix server.

https://i.imgur.com/5KIvGry.png

^This image shows you Zabbix in action; the mining rig didn't output any values for 2 minutes so the agent rebooted it. Explanations will follow.

What the agent basically does is parse the logs from Awesome miner. I've set a commandline in Awesome Miner to log to the zabbix folder, since it's the most easies way this way.
Quote
-logfile "c:\program files\zabbix\miner.log"
https://i.imgur.com/4tMRIZl.png

To install the Zabbix agent on your machine:
https://www.zabbix.com/download_agents
I use a W10 machine, firewall set to accept inbound and outbound 10050 and 10051 TCP.

Windows Config : zabbix_agentd.win.conf :
Code:
# This is a config file for the Zabbix agent daemon (Windows)
# To get more information about Zabbix, go to http://www.zabbix.com

LogFile=c:\program files\zabbix\zabbix_agentd.log

# EnableRemoteCommands=0

Server=<yourzabbixserverIP>
ListenPort=10050
ServerActive=<yourzabbixserverIP>

Linux Config : /etc/zabbix/zabbix-agentd.conf

https://www.zabbix.com/documentation/3.4/manual/concepts/agent

You can use Zypper (SLES) or apt-get (Debian and others) to install your agent.
Edit the conf file and make sure you have :
Code:
PidFile=/var/run/zabbix/zabbix-agentd.pid
Logfile=/var/log/zabbix/zabbix-agentd.log
EnableRemoteCommands = 1
Server=<yourzabbixserverIP>
ServerActive=<yourzabbixserverIP>

When you use Linux OS to mine, make sure you edit the Zabbix template (below) to reflect the correct location of the Mining Software output.

Awesome miner output loos like this :
Code:
23:25:29:951	1a3c	ETH: GPU0 29.448 Mh/s, GPU1 29.443 Mh/s, GPU2 30.167 Mh/s
23:25:31:849 f18 srv_thr cnt: 1, IP: 127.0.0.1
23:25:31:866 f18 recv: 51
23:25:31:877 f18 srv pck: 50
23:25:31:890 f18 srv bs: 0
23:25:31:902 f18 sent: 244
23:25:33:192 414 GPU 0 temp = 40, old fan speed = 58, new fan speed = 30
23:25:33:266 414 GPU 1 temp = 42, old fan speed = 58, new fan speed = 30
23:25:33:332 414 GPU 2 temp = 46, old fan speed = 63, new fan speed = 30

Zabbix will parse this into correct values, using Regex.

If you already have Zabbix or know how to make one, here is your Awesome miner Template to monitor the values. Remember to either alter the template's logfile location or use the commandline described above.
(This is for Zabbix 3.4)
nedfox (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
May 18, 2018, 09:38:58 PM
Last edit: May 18, 2018, 09:53:14 PM by nedfox
 #2

Save the text as awesometemplate.xml or something. Then import in Zabbix as a template.
https://justpaste.it/2a3bz

Apply the template to your mining rigs.
nedfox (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
May 18, 2018, 09:51:35 PM
 #3

Reserved for howto make Zabbix with Raspberry PI 3 V2
mettalmag
Legendary
*
Offline Offline

Activity: 1084
Merit: 1003


≡v≡


View Profile
May 19, 2018, 08:57:15 PM
 #4

I was testing it but I gave up,
in fact the only thing I wanted was to make zabbix triger the relay switch when it was unable to reboot the rig itself,
if it is and I'm sure it is somehow possible I can get back to testing with your help of course
nedfox (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
June 06, 2018, 09:43:59 PM
 #5

I bought a relayboard, hooked it onto the PI and wrote some Python to remotely (webbased) push the reset switch, or press the power button for 5 seconds or push it for a short time.
So I can reset, hard powerdown ánd power up the rig.

If you are interested, I can post the PY and PHP files. It takes a LOT of effort to make it work, but might be worth it.
mettalmag
Legendary
*
Offline Offline

Activity: 1084
Merit: 1003


≡v≡


View Profile
June 07, 2018, 05:43:01 AM
 #6

I bought a relayboard, hooked it onto the PI and wrote some Python to remotely (webbased) push the reset switch, or press the power button for 5 seconds or push it for a short time.
So I can reset, hard powerdown ánd power up the rig.

If you are interested, I can post the PY and PHP files. It takes a LOT of effort to make it work, but might be worth it.
doing it by yourself is fun but here is a tested and working version of relay
https://bitcointalk.org/index.php?topic=1725792.msg17270868#msg17270868
rahul_ka_dil2002
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
July 19, 2018, 09:02:07 AM
 #7

nedfox .....I have done same process... but not displaying graph ... Can you please help me on this??
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!