Page 1 of 2

Munin graph

PostPosted: Thu Feb 09, 2012 10:58 pm
by PoGo
Hello,
I wrote a plugin for munin to graph the active users in Subsonic (users currently playing music/video) : you can find it here

Just add it in your /etc/munin/plugins directory and don't forget to set the URL, LOGIN, PASSWORD options (login/password of a existing account in your subsonic)
I personally created an account for Munin with no right (can't even play music).

After few minutes you should see something like that :
Image

The plugin is working with version 4.6 (build 2585), and I have no idea if it can work with any previous version.

Cheers.

[EDIT]
v1.1 : Updated the parsing of the JSESSIONID
v1.2 : Automaticaly delete the cookie
v1.3 : Use the API

Re: Munin graph

PostPosted: Mon Feb 13, 2012 10:37 pm
by rino655
oh hell yea! Thank you sir, I will let be trying this out tonight.

Re: Munin graph

PostPosted: Tue Feb 14, 2012 12:14 am
by muiz
Where do i find : /etc/munin/plugins directory ?

Re: Munin graph

PostPosted: Tue Feb 14, 2012 8:51 am
by fonsoy
I take it this app is for Linux users only? :P

Re: Munin graph

PostPosted: Tue Feb 14, 2012 10:35 am
by PoGo
fonsoy wrote:I take it this app is for Linux users only? :P
Indeed.
There is a windows version of Munin, you can give a try : http://code.google.com/p/munin-node-win32/

Re: Munin graph

PostPosted: Fri Apr 13, 2012 8:43 am
by snoopyp
Hi,

Thanks for the plugin.

At the end of the script, missing:
print "users.value $users";

Re: Munin graph

PostPosted: Fri Apr 13, 2012 10:30 am
by snoopyp
Image

I think I have an error: nb of user is x2. I have try with 1 user and 2, see 2 and 4 in munin.

Re: Munin graph

PostPosted: Fri Apr 13, 2012 12:52 pm
by PoGo
Strange, I updated the script with a new version, you can try this one (see first post)
Also which version, do you use ? This script has only been tested on 4.6 (build 2585), I really don't know it's behavior with a previous version of subsonic.

Cheers.

Re: Munin graph

PostPosted: Fri Apr 13, 2012 1:04 pm
by snoopyp
I have: 4.6 (build 2583) - 2011-12-06

Where do you find v2585? I see lastet war version:
subsonic-4.6-war.zip 2011-12-06 18.3 MB

I have add this at the end:

#Print the result
$users=$users/2;
print "users.value $users\n";

Re: Munin graph

PostPosted: Tue Apr 17, 2012 12:23 pm
by snoopyp
mmm sometimes I have values with coma :/.
2,5 users...

What is your version?

Re: Munin graph

PostPosted: Thu Apr 19, 2012 2:04 pm
by PoGo
PoGo wrote:The plugin is working with version 4.6 (build 2585), and I have no idea if it can work with any previous version.

Re: Munin graph

PostPosted: Thu Apr 26, 2012 8:05 am
by snoopyp
Where did you find this version?
I have the last war version...

Re: Munin graph

PostPosted: Thu Apr 26, 2012 9:11 am
by PoGo
snoopyp wrote:Where did you find this version?
I have the last war version...

It's the .deb version : http://www.subsonic.org/pages/download2.jsp?target=subsonic-4.6.deb

Re: Munin graph

PostPosted: Wed May 09, 2012 9:13 am
by snoopyp
Ok, thanks.
I will be wait the 4.7 version :).

Re: Munin graph

PostPosted: Thu May 10, 2012 8:02 am
by PoGo
Also, remind that it's a "quick and dirty" way of doing.
If an user decided not to show what he's currently listening, he won't be included into the stats.

The best way I think is to ask Sindre an API to simply access to the right value.

[EDIT]
Talking of an API, there IS an API to properly get this value, I udated my script (can be found into my first post).