Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prosody_mem memory usage - lacking dependency info? #8

Open
Bretos opened this issue May 15, 2015 · 6 comments
Open

prosody_mem memory usage - lacking dependency info? #8

Bretos opened this issue May 15, 2015 · 6 comments

Comments

@Bretos
Copy link

Bretos commented May 15, 2015

When updatating, getting memory usage info generates munin errors:

2015/05/15-18:25:04 CONNECT TCP Peer: "[10.0.0.1]:55766" Local: "[10.0.0.12]:4949"
2015/05/15-18:25:11 [18552] Error output from prosody_mem:
2015/05/15-18:25:11 [18552]     Traceback (most recent call last):
2015/05/15-18:25:11 [18552]       File "/etc/munin/plugins/prosody_mem", line 234, in <module>
2015/05/15-18:25:11 [18552]         main()
2015/05/15-18:25:11 [18552]       File "/etc/munin/plugins/prosody_mem", line 78, in main
2015/05/15-18:25:11 [18552]         print "memory_total.value", mem_map["allocated"]
2015/05/15-18:25:11 [18552]     KeyError: 'allocated'
2015/05/15-18:25:11 [18552] Service 'prosody_mem' exited with status 1/0.
@gllmhyt
Copy link

gllmhyt commented May 16, 2015

Quite the same here (Debian Jessie, Prosody 0.10).

# munin-run prosody_mem
memory_total.value
Traceback (most recent call last):
  File "/etc/munin/plugins/prosody_mem", line 234, in <module>
    main()
  File "/etc/munin/plugins/prosody_mem", line 78, in main
    print "memory_total.value", mem_map["allocated"]
KeyError: 'allocated'

@hoedlmoser
Copy link

hoedlmoser commented Feb 25, 2017

same here, one of the commands used not working (any more?) with prosody 0.10

>for k,v in pairs(pposix.meminfo()) do print(k,v, '|') end
| Fatal error while running command, it did not complete
| Error: console:1: attempt to index global 'pposix' (a nil value)
>collectgarbage('count')*1024
| Result: 6322677

@hoedlmoser
Copy link

oh, pposix ist just not initialized. find patch below

--- prosody_.orig	2014-02-13 07:30:33.147382011 +0100
+++ prosody_	2017-02-25 14:26:23.436000000 +0100
@@ -63,7 +63,7 @@
         else:
             memstats_re = re.compile(r"\|\s(\w+)\s+(\d+)\s+\|")
             telnet = telnetlib.Telnet(host, port)
-            telnet.write(">for k,v in pairs(pposix.meminfo()) do print(k,v, '|') end\n")
+            telnet.write(">local pposix = assert(require 'util.pposix'); for k,v in pairs(pposix.meminfo()) do print(k,v, '|') end\n")
             mem_response = telnet.read_until("Result:", 5)
             telnet.write(">collectgarbage('count')*1024\n")
             telnet.write("quit\n")

@nioc
Copy link

nioc commented Oct 17, 2017

Same error on Debian stretch and Prosody 0.9.12-2.
The fix proposed by @hoedlmoser does not work for me.

@lemmy04
Copy link

lemmy04 commented Nov 2, 2017

same here. even with the patch above I still get:
(running on openSUSE Leap 42.3)

cloud:/etc/munin/plugins # munin-run prosody_mem memory_total.value Traceback (most recent call last): File "/etc/munin/plugins/prosody_mem", line 234, in <module> main() File "/etc/munin/plugins/prosody_mem", line 78, in main print "memory_total.value", mem_map["allocated"] KeyError: 'allocated'

@t2d
Copy link

t2d commented Nov 22, 2018

#8 (comment) works with Debian stretch and prosody 0.11.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants