[Mod] MTStat - server monitoring over http [mtstat]
-
- New member
- Posts: 7
- Joined: Mon Sep 03, 2018 09:47
- IRC: timdorohin
[Mod] MTStat - server monitoring over http [mtstat]
MTStat - mod providing server status (number of players, average load, max_lag, memory usage) in JSON over http
You can use it with your monitoring system, host your own back-end instance that provide web page with interactive charts or use back-end that i host at http://mtstat.us.openode.io/ - ask in topic or PM me if you want your server monitored.
Depends: nothing, but it runs on Linux-based servers only.
Source: https://github.com/timdorohin/mtstat
Download: https://github.com/timdorohin/mtstat/archive/master.zip
Back-end source: https://github.com/timdorohin/mtstat-server
License: GPLv3
Requires adding to trusted mods and installed luasocket library!
- Attachments
-
- thumbnail.png (14.32 KiB) Viewed 521 times
Last edited by timdorohin on Sat Sep 15, 2018 20:55, edited 4 times in total.
- rubenwardy
- Moderator
- Posts: 6978
- Joined: Tue Jun 12, 2012 18:11
- GitHub: rubenwardy
- IRC: rubenwardy
- In-game: rubenwardy
- Location: Bristol, United Kingdom
- Contact:
Re: [Mod] MTStat - server status over http [mtstat]
Don't tell people to disable security, this is very very very bad and never justified. Instead, use the mod whitelisting method. Your mod already supports this, the documentation is just wrong
-
- New member
- Posts: 7
- Joined: Mon Sep 03, 2018 09:47
- IRC: timdorohin
Re: [Mod] MTStat - server status over http [mtstat]
Enabled mods security (mtstat added to trusted!)rubenwardy wrote:Don't tell people to disable security, this is very very very bad and never justified. Instead, use the mod whitelisting method. Your mod already supports this, the documentation is just wrong
Code: Select all
2018-09-14 18:31:27: ERROR[Main]: ModError: Failed to load and run script from /home/tim/.minetest/mods/mtstat/init.lua:
2018-09-14 18:31:27: ERROR[Main]: require() is disabled when mod security is on.
2018-09-14 18:31:27: ERROR[Main]: stack traceback:
2018-09-14 18:31:27: ERROR[Main]: [C]: in function 'require'
2018-09-14 18:31:27: ERROR[Main]: /usr/share/lua/5.1/socket.lua:10: in main chunk
2018-09-14 18:31:27: ERROR[Main]: [C]: in function 'require'
2018-09-14 18:31:27: ERROR[Main]: /home/tim/.minetest/mods/mtstat/init.lua:42: in main chunk
2018-09-14 18:31:27: ERROR[Main]: Check debug.txt for details.
- rubenwardy
- Moderator
- Posts: 6978
- Joined: Tue Jun 12, 2012 18:11
- GitHub: rubenwardy
- IRC: rubenwardy
- In-game: rubenwardy
- Location: Bristol, United Kingdom
- Contact:
Re: [Mod] MTStat - server status over http [mtstat]
You need to use the insecure environment version of require
-
- New member
- Posts: 7
- Joined: Mon Sep 03, 2018 09:47
- IRC: timdorohin
Re: [Mod] MTStat - server status over http [mtstat]
Piece of my code:rubenwardy wrote:You need to use the insecure environment version of require
Code: Select all
local insecure = minetest.request_insecure_environment()
assert(insecure, "Add mtstat mod to trusted!")
... (skipped irrelevant parts)
local socket = insecure.require('socket') -- fails there.
assert(socket, 'Disable mod security!')
Code: Select all
old_require = require -- Hacky hack
require = insecure.require -- Setting global require to insecure 'cause
local socket = require('socket') -- When we try to load any lib that uses require() itself
require = old_require -- We will get errors otherwise
Who is online
Users browsing this forum: Bing [Bot] and 31 guests