Code Monkey home page Code Monkey logo

Comments (7)

md2k avatar md2k commented on June 10, 2024 1

it wont work straight forward.
Need to create custom discovery which is collect from all users its processes and pm-zabbix daemon will send later to Zabbix-server their stats. or need allow pm2-zabbix to register itself keys with some custom index to allow separation of each pm2-zabbix service per user.

Or create virtual Host as you mentioned before, what is not best approach, but currently only one which allow monitor multiple PM2 running under different users.

from pm2-zabbix.

rkaw92 avatar rkaw92 commented on June 10, 2024

Hi,
that's an interesting question. It should be possible to send data for 2 lists of processes (provided that they do not have conflicting <name>-<ID> pairs), but at the same time, gathering stats about the PM2 daemon itself only produces a constant set of keys per host. Naturally, Zabbix would overwrite the PM2 data items in a last-write-wins fashion - not what anyone wants.

Therefore, it seems that currently the only solution is alternating hostnames for those different users - faking multiple hosts. Whether this is going to be implemented in another way in the nearest future - I do not think so, because it would require changing the "shape" of all keys to also include the username in the item key, and that is a breaking change.

If we receive a pull request that does enable an optional, alternate mode of data-sending, with the keys including a [username] index, then I would be inclined to add it to this tool.

from pm2-zabbix.

md2k avatar md2k commented on June 10, 2024

I not interesting in monitoring pm2 process itself, because if all services became down it is obviously means that this is a problem :) cpu/memory consumption as for me it is ok to have basic CPU/RAM monitoring if i'll see that CPU/Memory consumption jumps, it will mean that instance require some manual attention any way.
So, in my opinion, most important it is possibility to monitor services managed by PM2 rather than PM2 itself. but for future it will be nice to have possibility to have multiple PM2 Daemon monitoring capabilities.
One of the ways , make configuration options for pm2-zabbix to register itself separate pm2._ commands (keys) which can be later used in templates. i think this will be is most logical approach (it will keep backward compatibility because without config options all will work as now. and with options commands will have index int or word).

Also to have two pm2-zabbix just for services reporting hard to achieve, discovery rule can trigger only one of them. of course it is possible create 2 discovery rules, but then Zabbix complain that same key already used with another discovery rule (in same template, didn't tried to create 2 different templates).

from pm2-zabbix.

rkaw92 avatar rkaw92 commented on June 10, 2024

I agree that it does not seem to be possible without resorting to fake hosts, or writing custom "data gathering" scripts that take data from multiple users.

To avoid introducing half-measures, I would refrain from implementing such system-wide discovery / monitor wrappers, and instead opt to add the option to use per-user PM2 daemon and process keys (which would, in turn, require using separate Zabbix templates and agent discovery entries for LLD to be useful, of course).

I must say that we are a bit busy at the moment, and the resources devoted to development of new pm2-zabbix features are rather minimal, so do not expect this feature to appear for the next few weeks. If you would rather implement this yourself, go ahead - pull requests are always welcome!

from pm2-zabbix.

md2k avatar md2k commented on June 10, 2024

@rkaw92, here no haste, it more like feature request, because faced this problem. pull request for me not a option, nodejs not my field, i'm more about golang, so will prefer to wait if this functionality will be some where later. and thanks for such software.

from pm2-zabbix.

Warfunck avatar Warfunck commented on June 10, 2024

Hi,
"Need to create custom discovery which is collect from all users its processes and pm-zabbix daemon will send later to Zabbix-server their stats". Can we expect the addition of this feature in the near future?

from pm2-zabbix.

rkaw92 avatar rkaw92 commented on June 10, 2024

@Warfunck Your best bet right now is adding this and issuing a PR.

from pm2-zabbix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.