Author Topic: Munin Plugin?  (Read 8090 times)

Offline schlobjob

  • Junior Indexer
  • **
  • Posts: 28
  • Helpful: +1/-0
Munin Plugin?
« on: 2016-11-09, 11:30:32 AM »
Hi,
is anyone using Munin to monitor the nZEDb server? I am very happy about using it, but besides the mysql and "normal" plugins i would love to see additional nZEDb-related data, like parts / binaries / collections etc.

Offline censor

  • Junior Indexer
  • **
  • Posts: 22
  • Helpful: +3/-0
Re: Munin Plugin?
« Reply #1 on: 2017-02-15, 09:08:24 AM »
I've written a template and script for Cacti, which gives me the number of releases in each category - but adding CPB sounds like a good idea!
Let me add those, and i'll publish the files somewhere.

Regarding Munin: just write one yourself, i guess it's a lot easier to do for Munin than for Cacti ;-)

Offline ThePeePs

  • Overlord
  • ******
  • Posts: 44
  • Helpful: +7/-0
  • Hardware mod'er and p/t coder
    • nZEDb by ThePeePs
Re: Munin Plugin?
« Reply #2 on: 2017-02-21, 09:36:16 PM »
I found that there is a github repo for third party plugins that has a plugin for that "other indexer".
I edited it to work with nZEDb.  It's still a work in progress, but let me know your thoughts.


Offline schlobjob

  • Junior Indexer
  • **
  • Posts: 28
  • Helpful: +1/-0
Re: Munin Plugin?
« Reply #3 on: 2017-02-23, 12:17:46 AM »
I edited it to work with nZEDb.  It's still a work in progress, but let me know your thoughts.
when i try the plugin with munin-run, i just get the error
Code: [Select]
Unknown graph  at /etc/munin/plugins/nzedb_ line 288.any idea what i am doing wrong?
i set up
Code: [Select]
/etc/munin/plugin-conf.d/nzedb_ with
Code: [Select]
[nzedb_*]
env.mysqlconnection DBI:mysql:namedatabase;host=127.0.0.1;port=3306
env.mysqluser nameuser
env.mysqlpassword password
« Last Edit: 2017-02-23, 12:23:49 AM by schlobjob »

Offline ThePeePs

  • Overlord
  • ******
  • Posts: 44
  • Helpful: +7/-0
  • Hardware mod'er and p/t coder
    • nZEDb by ThePeePs
Re: Munin Plugin?
« Reply #4 on: 2017-02-23, 07:41:49 AM »
Oh, sorry. should have included some doc, when you setup the symlink, you need to set them up as follows:

Code: [Select]
/etc/munin/plugins# ls -l | grep nze
lrwxrwxrwx 1 root root   31 Feb 21 23:48 nzedb_api -> /usr/share/munin/plugins/nzedb_
lrwxrwxrwx 1 root root   31 Feb 21 23:48 nzedb_category -> /usr/share/munin/plugins/nzedb_
lrwxrwxrwx 1 root root   31 Feb 22 13:10 nzedb_users -> /usr/share/munin/plugins/nzedb_
lrwxrwxrwx 1 root root   31 Feb 21 23:48 nzedb_releases -> /usr/share/munin/plugins/nzedb_

Each one will generate a different graph.  I am also working on adding a few others, like a parent only category graph, cause the "big" one is a bit hard to read, and CBP, predb, and maybe what's in post-processing.

The main problem is, to get any of this data, requires querying the db, which on larger sites, might cause issues.  That being said, I might look at modding the tmux monitor script to generate a txt file when it updates, and have munin hit that for stats. If not that, then just working off the information_schema since those queries are much lighter.

Offline schlobjob

  • Junior Indexer
  • **
  • Posts: 28
  • Helpful: +1/-0
Re: Munin Plugin?
« Reply #5 on: 2017-02-23, 12:05:09 PM »
Perfect  :D got it working! thank you so much!

Offline ThePeePs

  • Overlord
  • ******
  • Posts: 44
  • Helpful: +7/-0
  • Hardware mod'er and p/t coder
    • nZEDb by ThePeePs
Re: Munin Plugin?
« Reply #6 on: 2017-02-23, 03:15:39 PM »
You're welcome.  BTW, I just updated it again, to include CBP.  I'll make sure to update this thread anytime I make improvements it it.  It still needs a lot of cleaning up, and I might pull the "bigger" category graph, cause it's a longer DB query, and the graph is kinda hard to read.

Any other suggestions comments are welcome.

Offline ThePeePs

  • Overlord
  • ******
  • Posts: 44
  • Helpful: +7/-0
  • Hardware mod'er and p/t coder
    • nZEDb by ThePeePs
Re: Munin Plugin?
« Reply #7 on: 2017-03-10, 08:14:29 AM »
I just updated Gist, here's what has changed:

  • Added a new graph for PreDB
  • Added number of NFO's and Renames to the Releases graph
  • Cleaned up some of the queries so they run faster

As always comments and suggestions are welcome.

Offline schlobjob

  • Junior Indexer
  • **
  • Posts: 28
  • Helpful: +1/-0
Re: Munin Plugin?
« Reply #8 on: 2017-03-13, 01:40:50 AM »
got the new version running, very nice!
One small problem: when i call
Code: [Select]
nzedb_cbp it shows 0 for all of the values:
Code: [Select]
Collections.value 0
Binaries.value 0
Parts.value 0
Missing_Parts.value 0
Parts_Repair.value 0
Any idea where i made a mistake?

Offline ThePeePs

  • Overlord
  • ******
  • Posts: 44
  • Helpful: +7/-0
  • Hardware mod'er and p/t coder
    • nZEDb by ThePeePs
Re: Munin Plugin?
« Reply #9 on: 2017-03-14, 07:08:13 AM »
If you aren't using TPG (you should be, as it's going to be required soon) then you need to change the regexs on the if's in lines 483-491 and remove the trailing "_"

Offline schlobjob

  • Junior Indexer
  • **
  • Posts: 28
  • Helpful: +1/-0
Re: Munin Plugin?
« Reply #10 on: 2017-03-14, 01:19:28 PM »
just changed to TGP and suddenly the system is really fast  :) the plugin works perfectly.