greatcare / pm2-zabbix

A Node.js PM2 monitoring tool for Zabbix.
MIT License
87 stars 60 forks source link

zabbix did not collect data #19

Open jhan-aa opened 6 years ago

jhan-aa commented 6 years ago

root@lw-mi-aa-s-react-1:~/pm2-zabbix/install/zabbix-agent# sudo -u www-data PM2_HOME=/etc/nodejs_home/.pm2 pm2-zabbix --monitor {"name":"pm2-zabbix","hostname":"lw-mi-aa-s-react-1.appannie.org","pid":7084,"level":50,"event":"PM2ZabbixMonitor#PM2StatusSent","error":{"errno":-2,"code":"ENOENT","syscall":"open","path":"/var/www//etc/nodejs_home/.pm2/pm2.pid"},"msg":"Failed to send PM2 status: Error: ENOENT: no such file or directory, open '/var/www//etc/nodejs_home/.pm2/pm2.pid'","time":"2017-09-07T09:12:57.505Z","v":0} {"name":"pm2-zabbix","hostname":"lw-mi-aa-s-react-1.appannie.org","pid":7084,"level":50,"event":"PM2ZabbixMonitor#processListSendingError","error":{"killed":false,"code":1,"signal":null,"cmd":"/usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file -"},"msg":"Failed to send process list with stats to server: Error: Command failed: /usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file -\n","time":"2017-09-07T09:12:57.523Z","v":0} root@lw-mi-aa-s-react-1:~/pm2-zabbix/install/zabbix-agent# sudo -u www-data PM2_HOME=/etc/nodejs_home/.pm2 pm2-zabbix --discover { "data": [ { "{#PROCESS_ID}": "AA React-0", "{#PROCESS_NAME}": "AA React" }, { "{#PROCESS_ID}": "AA React-1", "{#PROCESS_NAME}": "AA React" }, { "{#PROCESS_ID}": "AA React-2", "{#PROCESS_NAME}": "AA React" }

I am running the pm2 and nodejs with www-data, and a customize home dir. I can get the data by --discover; But from zabbix it did not collect anything. Can you help check where i loss configuration from the above output

jhan-aa commented 6 years ago

I think pm2-zabbix is an very useful tool to collect the data at process level. Really want to make it works, thanks in advance.

-Jilong(jhan@appannie.com)

rkaw92 commented 6 years ago

Hi, it appears that this is partially the same issue as your other issue with PM2 file paths (referred in #16), as can be seen in the error message {"errno":-2,"code":"ENOENT","syscall":"open","path":"/var/www//etc/nodejs_home/.pm2/pm2.pid"}. The other error code - -1 - from zabbix_sender, obtained while sending the process list to Zabbix, seems to indicate a connecton failure with the server. You should check whether you can send anything, and inspect the config file to determine whether the server IP / port is correct.

Regarding the wrong paths for pm2.pid, I have looked at the code and nothing immediately stands out that could cause such a weird joining of paths - we use pm2's own logic for deriving the pidfile path. Are you using the latest pm2-zabbix version, 0.3.2?

rkaw92 commented 6 years ago

Also if you run with an env variable of DEBUG=pm2:paths you should see what pm2 resolves the paths to (should be at the top of the log output). This obviously only works in the current version.

ang3lwitch commented 6 years ago

ya, I am having same issue, previous version was just dandy. Seems to me something is a miss, or I am just doing it wrong. New build just fails for me:

pm2-zabbix --monitor --debug {"name":"pm2-zabbix","hostname":"AwesomeHost","pid":30809,"level":50,"event":"PM2ZabbixMonitor#processListSendingError","error":{"killed":false,"code":2,"signal":null,"cmd":"/usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file -"},"msg":"Failed to send process list with stats to server: Error: Command failed: /usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf

I know my configs are accurate and precisely edited. Help me with the needle

rkaw92 commented 6 years ago

@ang3lwitch This looks like a different kind of problem. Are you positive that it used to work with a previous version? Could you please check? Error code 2 from the sender typically means that some items could not be processed by the server (no keys created on the server side, or hostname not accepted). Be sure to check the README section on Logging and see if the keys being sent to the server (zabbix_sender input) look sane.

Let me know of any observations regarding above.

jhan-aa commented 6 years ago

root@lw-mi-aa-s-react-1:~/pm2-zabbix/lib# su - www-data -s /bin/bash -c 'PM2_HOME=/etc/nodejs_home/.pm2 /usr/bin/pm2-zabbix --monitor --debug' {"name":"pm2-zabbix","hostname":"lw-mi-aa-s-react-1.appannie.org","pid":53874,"level":50,"event":"PM2ZabbixMonitor#PM2StatusSent","error":{"errno":-2,"code":"ENOENT","syscall":"open","path":"/var/www//etc/nodejs_home/.pm2/pm2.pid"},"msg":"Failed to send PM2 status: Error: ENOENT: no such file or directory, open '/var/www//etc/nodejs_home/.pm2/pm2.pid'","time":"2017-09-08T05:33:04.743Z","v":0} {"name":"pm2-zabbix","hostname":"lw-mi-aa-s-react-1.appannie.org","pid":53874,"level":50,"event":"PM2ZabbixMonitor#processListSendingError","error":{"killed":false,"code":1,"signal":null,"cmd":"/usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file -"},"msg":"Failed to send process list with stats to server: Error: Command failed: /usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file -\n","time":"2017-09-08T05:33:04.754Z","v":0}

Hi There, debug gives me same output, i am confusing why it will find pid file under var/www//etc/nodejs_home/.pm2/pm2.pid. The correct path should be under /etc/nodejs_home/.pm2/pm2.pid. And i am using www-data user without an shell, so i run the command by : su - www-data -s /bin/bash

My zabbix version is 2.4

rkaw92 commented 6 years ago

@jhan-aa What version of pm2-zabbix are you using? Can you run with DEBUG=pm2:paths to see why the path is being resolved in such a manner?

ang3lwitch commented 6 years ago

ok, I was busy today. I have about 4 machines with pm2-zabbix that work just fine.

For those hosts I am using: "name": "pm2-zabbix", "version": "0.1.2",

I am all for something newer.

Setup is really straight forward so I was perplexed in that I cannot get new versions to work proper.

On Thu, Sep 7, 2017 at 3:27 PM, Robert Kawecki notifications@github.com wrote:

@ang3lwitch https://github.com/ang3lwitch This looks like a different kind of problem. Are you positive that it used to work with a previous version? Could you please check? Error code 2 from the sender typically means that some items could not be processed by the server (no keys created on the server side, or hostname not accepted). Be sure to check the README section on Logging and see if the keys being sent to the server (zabbix_sender input) look sane.

Let me know of any observations regarding above.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/greatcare/pm2-zabbix/issues/19#issuecomment-327899669, or mute the thread https://github.com/notifications/unsubscribe-auth/AXk91oOawHD1DzwwrM7q3FWMQxociDdFks5sgEOxgaJpZM4PPhr7 .

ang3lwitch commented 6 years ago

ok, aha!

So the confusion was in that, when you say it relies on zabbix-sender.

I was thinking that since zabbix-agent zabbix-sender and zabbix-get were installed on my host that I did not need the "node-zabbix-sender (wrapper).

I believe the confusion could have been missed maybe if you put a link within the pm2-zabbix doc to actually add it.

Or i could get wiser and put 2 and 2 together.

I will work with this for now and report back.

On Fri, Sep 8, 2017 at 2:01 PM, allen orlowski allen.orlowski@gmail.com wrote:

ok, I was busy today. I have about 4 machines with pm2-zabbix that work just fine.

For those hosts I am using: "name": "pm2-zabbix", "version": "0.1.2",

I am all for something newer.

Setup is really straight forward so I was perplexed in that I cannot get new versions to work proper.

On Thu, Sep 7, 2017 at 3:27 PM, Robert Kawecki notifications@github.com wrote:

@ang3lwitch https://github.com/ang3lwitch This looks like a different kind of problem. Are you positive that it used to work with a previous version? Could you please check? Error code 2 from the sender typically means that some items could not be processed by the server (no keys created on the server side, or hostname not accepted). Be sure to check the README section on Logging and see if the keys being sent to the server (zabbix_sender input) look sane.

Let me know of any observations regarding above.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/greatcare/pm2-zabbix/issues/19#issuecomment-327899669, or mute the thread https://github.com/notifications/unsubscribe-auth/AXk91oOawHD1DzwwrM7q3FWMQxociDdFks5sgEOxgaJpZM4PPhr7 .

rkaw92 commented 6 years ago

@ang3lwitch It does depend on the sender wrapper module, but the module is already included in dependencies, so there are no special steps involved (such as installing it globally). You do not need to install the sender wrapper separately. The wrapper is just a tiny script that runs the proper zabbix_sender binary and formats data for sending, and is already included when you do npm install [-g] pm2-zabbix.

From the output you posted, it appears that all parts are in place, yet the host is refusing your items (error code 2 - see zabbix_sender manpage, the one from Zabbix itself, since zabbix_sender comes from there).

ang3lwitch commented 6 years ago

Is the zabbix_sender version Within zabbix dependent upon the pm2 zabbix node version

My zabbix sender version is 3.2.7

On Sep 8, 2017 2:26 PM, "Robert Kawecki" notifications@github.com wrote:

@ang3lwitch https://github.com/ang3lwitch It does depend on the sender wrapper module, but the module is already included in dependencies, so there are no special steps involved (such as installing it globally). You do not need to install the sender wrapper separately. The wrapper is just a tiny script that runs the proper zabbix_sender binary and formats data for sending, and is already included when you do npm install [-g] pm2-zabbix.

From the output you posted, it appears that all parts are in place, yet the host is refusing your items (error code 2 - see zabbix_sender manpage, the one from Zabbix itself, since zabbix_sender comes from there).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/greatcare/pm2-zabbix/issues/19#issuecomment-328179590, or mute the thread https://github.com/notifications/unsubscribe-auth/AXk91nVQdCl65yBm-eSxGvH69PrQps6nks5sgYbggaJpZM4PPhr7 .

rkaw92 commented 6 years ago

@ang3lwitch the only version that really matters is that of pm2-zabbix, this module. What version of our module are you having problems with? You stated that the "new build fails", which would indicate a regression from a version that works to one that does not. Therefore, I'm trying to find out which two versions those are. After we have established that a) your setup works with an earlier version on this host and b) it does not work with the latest version, we can proceed with finding a bug.

ang3lwitch commented 6 years ago

Hi Robert,

The working version I have is v0.1.2 https://github.com/greatcare/pm2-zabbix/releases/tag/v0.1.2 It worked like a charm from the get go with the very basic instructions provided by you. It just works.

The version I am using with some new hosts is the latest build you have, I believe that to be 0.3.2.

I install not from source, but from the npm command, " npm -g install pm2-zabbix"

I attached the install log so you can see the latest version.

so like others experienced, pm2-zabbix --discover works dandy. either from root or sudo -u to another user.

When pm2-zabbix --monitor gets executed. That is where it complains about zabbix-sender and the -Input file issue.

I hope that helps.

On Fri, Sep 8, 2017 at 4:07 PM, Robert Kawecki notifications@github.com wrote:

@ang3lwitch https://github.com/ang3lwitch the only version that really matters is that of pm2-zabbix, this module. What version of our module are you having problems with? You stated that the "new build fails", which would indicate a regression from a version that works to one that does not. Therefore, I'm trying to find out which two versions those are. After we have established that a) your setup works with an earlier version on this host and b) it does not work with the latest version, we can proceed with finding a bug.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/greatcare/pm2-zabbix/issues/19#issuecomment-328201638, or mute the thread https://github.com/notifications/unsubscribe-auth/AXk91l5KUMdg2KyVORQXmQBRPYyEwcFdks5sgZ6ZgaJpZM4PPhr7 .

/usr/local/bin/pm2-zabbix -> /usr/local/lib/node_modules/pm2-zabbix/monitor.js

dtrace-provider@0.8.5 install /usr/local/lib/node_modules/pm2-zabbix/node_modules/dtrace-provider node scripts/install.js

/usr/local/lib └─┬ pm2-zabbix@0.3.2 ├─┬ bunyan@1.8.12 │ ├─┬ dtrace-provider@0.8.5 │ │ └── nan@2.7.0 │ ├── moment@2.18.1 │ ├─┬ mv@2.1.1 │ │ ├── ncp@2.0.0 │ │ └─┬ rimraf@2.4.5 │ │ └── glob@6.0.4 │ └── safe-json-stringify@1.0.4 ├── minimist@1.2.0 ├── pidusage@1.1.6 ├─┬ pm2@2.6.1 │ ├─┬ async@2.5.0 │ │ └── lodash@4.17.4 │ ├── blessed@0.1.81 │ ├─┬ chalk@1.1.3 │ │ ├── ansi-styles@2.2.1 │ │ ├── escape-string-regexp@1.0.5 │ │ ├─┬ has-ansi@2.0.0 │ │ │ └── ansi-regex@2.1.1 │ │ ├── strip-ansi@3.0.1 │ │ └── supports-color@2.0.0 │ ├─┬ chokidar@1.7.0 │ │ ├─┬ anymatch@1.3.2 │ │ │ ├─┬ micromatch@2.3.11 │ │ │ │ ├─┬ arr-diff@2.0.0 │ │ │ │ │ └── arr-flatten@1.1.0 │ │ │ │ ├── array-unique@0.2.1 │ │ │ │ ├─┬ braces@1.8.5 │ │ │ │ │ ├─┬ expand-range@1.8.2 │ │ │ │ │ │ └─┬ fill-range@2.2.3 │ │ │ │ │ │ ├── is-number@2.1.0 │ │ │ │ │ │ ├── isobject@2.1.0 │ │ │ │ │ │ ├─┬ randomatic@1.1.7 │ │ │ │ │ │ │ ├─┬ is-number@3.0.0 │ │ │ │ │ │ │ │ └── kind-of@3.2.2 │ │ │ │ │ │ │ └── kind-of@4.0.0 │ │ │ │ │ │ └── repeat-string@1.6.1 │ │ │ │ │ ├── preserve@0.2.0 │ │ │ │ │ └── repeat-element@1.1.2 │ │ │ │ ├─┬ expand-brackets@0.1.5 │ │ │ │ │ └── is-posix-bracket@0.1.1 │ │ │ │ ├── extglob@0.3.2 │ │ │ │ ├── filename-regex@2.0.1 │ │ │ │ ├─┬ kind-of@3.2.2 │ │ │ │ │ └── is-buffer@1.1.5 │ │ │ │ ├─┬ object.omit@2.0.1 │ │ │ │ │ ├─┬ for-own@0.1.5 │ │ │ │ │ │ └── for-in@1.0.2 │ │ │ │ │ └── is-extendable@0.1.1 │ │ │ │ ├─┬ parse-glob@3.0.4 │ │ │ │ │ ├── glob-base@0.3.0 │ │ │ │ │ └── is-dotfile@1.0.3 │ │ │ │ └─┬ regex-cache@0.4.4 │ │ │ │ └─┬ is-equal-shallow@0.1.3 │ │ │ │ └── is-primitive@2.0.0 │ │ │ └─┬ normalize-path@2.1.1 │ │ │ └── remove-trailing-separator@1.1.0 │ │ ├── async-each@1.0.1 │ │ ├── glob-parent@2.0.0 │ │ ├── inherits@2.0.3 │ │ ├─┬ is-binary-path@1.0.1 │ │ │ └── binary-extensions@1.10.0 │ │ ├─┬ is-glob@2.0.1 │ │ │ └── is-extglob@1.0.0 │ │ ├── path-is-absolute@1.0.1 │ │ └─┬ readdirp@2.1.0 │ │ ├── graceful-fs@4.1.11 │ │ ├─┬ minimatch@3.0.4 │ │ │ └─┬ brace-expansion@1.1.8 │ │ │ ├── balanced-match@1.0.0 │ │ │ └── concat-map@0.0.1 │ │ ├─┬ readable-stream@2.3.3 │ │ │ ├── core-util-is@1.0.2 │ │ │ ├── isarray@1.0.0 │ │ │ ├── process-nextick-args@1.0.7 │ │ │ ├── safe-buffer@5.1.1 │ │ │ ├── string_decoder@1.0.3 │ │ │ └── util-deprecate@1.0.2 │ │ └── set-immediate-shim@1.0.1 │ ├── cli-table-redemption@1.0.1 │ ├── commander@2.11.0 │ ├─┬ cron@1.2.1 │ │ └── moment-timezone@0.5.13 │ ├─┬ debug@2.6.8 │ │ └── ms@2.0.0 │ ├── eventemitter2@1.0.5 │ ├── fclone@1.0.11 │ ├── gkt@1.0.0 │ ├─┬ mkdirp@0.5.1 │ │ └── minimist@0.0.8 │ ├─┬ needle@1.6.0 │ │ └── iconv-lite@0.4.18 │ ├─┬ nssocket@0.6.0 │ │ ├── eventemitter2@0.4.14 │ │ └── lazy@1.0.11 │ ├─┬ pm2-axon@3.0.2 │ │ ├── amp@0.3.1 │ │ ├── amp-message@0.1.2 │ │ ├─┬ debug@2.2.0 │ │ │ └── ms@0.7.1 │ │ └── escape-regexp@0.0.1 │ ├─┬ pm2-axon-rpc@0.4.5 │ │ └── fclone@1.0.8 │ ├─┬ pm2-deploy@0.3.7 │ │ ├── async@1.5.2 │ │ └── tv4@1.3.0 │ ├─┬ pm2-multimeter@0.1.2 │ │ └── charm@0.1.2 │ ├─┬ pmx@1.5.0 │ │ ├── shimmer@1.1.0 │ │ └─┬ vxx@1.2.2 │ │ ├─┬ continuation-local-storage@3.2.0 │ │ │ ├── async-listener@0.6.7 │ │ │ └─┬ emitter-listener@1.0.1 │ │ │ └── shimmer@1.0.0 │ │ ├── extend@3.0.1 │ │ ├── is@3.2.1 │ │ ├── lodash.findindex@4.6.0 │ │ ├── lodash.isequal@4.5.0 │ │ ├── lodash.merge@4.6.0 │ │ ├── methods@1.1.2 │ │ └── uuid@3.1.0 │ ├─┬ promptly@2.2.0 │ │ └─┬ read@1.0.7 │ │ └── mute-stream@0.0.7 │ ├── semver@5.4.1 │ ├─┬ shelljs@0.7.8 │ │ ├─┬ glob@7.1.2 │ │ │ ├── fs.realpath@1.0.0 │ │ │ ├─┬ inflight@1.0.6 │ │ │ │ └── wrappy@1.0.2 │ │ │ └── once@1.4.0 │ │ ├── interpret@1.0.3 │ │ └─┬ rechoir@0.6.2 │ │ └─┬ resolve@1.4.0 │ │ └── path-parse@1.0.5 │ ├─┬ source-map-support@0.4.17 │ │ └── source-map@0.5.7 │ ├── sprintf-js@1.1.1 │ ├─┬ vizion@0.2.13 │ │ └── async@1.5.2 │ └─┬ yamljs@0.3.0 │ ├─┬ argparse@1.0.9 │ │ └── sprintf-js@1.0.3 │ └── glob@7.1.2 ├── when@3.7.8 └── zabbix-sender@0.3.0 (git://github.com/greatcare/node-zabbix-sender.git#e4e1566672ff0c4185f3f2d70a35b05514dcee4a)

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/pm2-zabbix/node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

rkaw92 commented 6 years ago

@ang3lwitch It should be possible in the newest version to dump the keys/values being sent.

jhan-aa commented 6 years ago

@rkaw92 thanks for your reply. Pls see the screen shot

image

And i am using root@lw-mi-aa-s-react-1:~# npm ls | grep pm2-zabbix └─┬ pm2-zabbix@0.3.2

Also pls note, i am using www-data to start pm2 and nodejs, www-data has no it's own shell. So when start nodejs by pm2, i manually specify the home dir under /etc/nodejs_home, so every time i run the pm2 command to check status, log, restart... i have to add some env vairiable and specify the user:

Like: root@lw-mi-aa-s-react-1:~# su - www-data -s /bin/bash -c 'PM2_HOME=/etc/nodejs_home/.pm2 pm2 restart /etc/nodejs_home/.pm2/pm2.server.yml'

rkaw92 commented 6 years ago

@jhan-aa Acknowledged. Can you try the version from master? It contains some fixes regarding path handling. npm install -g greatcare/pm2-zabbix

There are actually 2 issues on the screenshot, and only 1 is related to paths. The other one (error code 2) you will need to debug as outlined in my previous post. EDIT: Misread the error code (probably from having 2 logs at once in the same issue). Your error code is actually 1 - connection error. Make sure you can connect to the Zabbix server.

If the path fix works, I'm cutting a new release.

ang3lwitch commented 6 years ago

Hi Robert,

Ok, had some time to work on this. So, from a fresh install from your branch

npm install -g greatcare/pm2-zabbix

ran "pm2-zabbix --LOG_LEVEL=trace --monitor"

{"name":"pm2-zabbix","hostname":"AwesomeHost","pid":13515,"level":50,"event":"PM2ZabbixMonitor#processListSendingError","error":{"killed":false,"code":2,"signal":null,"cmd":"/usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file -"},"msg":"Failed to send process list with stats to server: Error: Command failed: /usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file -\n","time":"2017-09-11T18:50:59.016Z","v":0}

I normally would expect to see an "ok" after running pm2-zabbix but it is failing pretty much with same errors.

On Mon, Sep 11, 2017 at 3:46 AM, Robert Kawecki notifications@github.com wrote:

@jhan-aa https://github.com/jhan-aa Acknowledged. Can you try the version from master? It contains some fixes regarding path handling. npm install -g greatcare/pm2-zabbix

There are actually 2 issues on the screenshot, and only 1 is related to paths. The other one (error code 2) you will need to debug as outlined in my previous post.

If the path fix works, I'm cutting a new release.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/greatcare/pm2-zabbix/issues/19#issuecomment-328446280, or mute the thread https://github.com/notifications/unsubscribe-auth/AXk91vDlxbGwSvsusWQkU56TQ9s2WRziks5shOVggaJpZM4PPhr7 .

rkaw92 commented 6 years ago

Hi, you need to prepend the LOG_LEVEL=..., because it is an environmental variable, like so: LOG_LEVEL=trace pm2-zabbix --monitor

This should show the generated data being sent. It will not fix the problem itself, but will provide insight into what to look for in the config / on the Zabbix server.

Dnia 11 września 2017 21:16:23 CEST, ang3lwitch notifications@github.com napisał(a):

Hi Robert,

Ok, had some time to work on this. So, from a fresh install from your branch

npm install -g greatcare/pm2-zabbix

ran "pm2-zabbix --LOG_LEVEL=trace --monitor"

{"name":"pm2-zabbix","hostname":"AwesomeHost","pid":13515,"level":50,"event":"PM2ZabbixMonitor#processListSendingError","error":{"killed":false,"code":2,"signal":null,"cmd":"/usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file -"},"msg":"Failed to send process list with stats to server: Error: Command failed: /usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file -\n","time":"2017-09-11T18:50:59.016Z","v":0}

I normally would expect to see an "ok" after running pm2-zabbix but it is failing pretty much with same errors.

On Mon, Sep 11, 2017 at 3:46 AM, Robert Kawecki notifications@github.com wrote:

@jhan-aa https://github.com/jhan-aa Acknowledged. Can you try the version from master? It contains some fixes regarding path handling. npm install -g greatcare/pm2-zabbix

There are actually 2 issues on the screenshot, and only 1 is related to paths. The other one (error code 2) you will need to debug as outlined in my previous post.

If the path fix works, I'm cutting a new release.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub

https://github.com/greatcare/pm2-zabbix/issues/19#issuecomment-328446280, or mute the thread

https://github.com/notifications/unsubscribe-auth/AXk91vDlxbGwSvsusWQkU56TQ9s2WRziks5shOVggaJpZM4PPhr7 .

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/greatcare/pm2-zabbix/issues/19#issuecomment-328630636

-- Wysłane za pomocą K-9 Mail.

ang3lwitch commented 6 years ago

Oops. Well clearly i did not follow instruction. I will try again tonight. Thanks for reply.

On Sep 11, 2017 4:23 PM, "Robert Kawecki" notifications@github.com wrote:

Hi, you need to prepend the LOG_LEVEL=..., because it is an environmental variable, like so: LOG_LEVEL=trace pm2-zabbix --monitor

This should show the generated data being sent. It will not fix the problem itself, but will provide insight into what to look for in the config / on the Zabbix server.

Dnia 11 września 2017 21:16:23 CEST, ang3lwitch notifications@github.com napisał(a):

Hi Robert,

Ok, had some time to work on this. So, from a fresh install from your branch

npm install -g greatcare/pm2-zabbix

ran "pm2-zabbix --LOG_LEVEL=trace --monitor"

{"name":"pm2-zabbix","hostname":"AwesomeHost","pid": 13515,"level":50,"event":"PM2ZabbixMonitor#processListSendingError"," error":{"killed":false,"code":2,"signal":null,"cmd":"/usr/ bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file -"},"msg":"Failed to send process list with stats to server: Error: Command failed: /usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file -\n","time":"2017-09-11T18:50:59.016Z","v":0}

I normally would expect to see an "ok" after running pm2-zabbix but it is failing pretty much with same errors.

On Mon, Sep 11, 2017 at 3:46 AM, Robert Kawecki notifications@github.com wrote:

@jhan-aa https://github.com/jhan-aa Acknowledged. Can you try the version from master? It contains some fixes regarding path handling. npm install -g greatcare/pm2-zabbix

There are actually 2 issues on the screenshot, and only 1 is related to paths. The other one (error code 2) you will need to debug as outlined in my previous post.

If the path fix works, I'm cutting a new release.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub

<https://github.com/greatcare/pm2-zabbix/issues/19#issuecomment-328446280 , or mute the thread

https://github.com/notifications/unsubscribe-auth/ AXk91vDlxbGwSvsusWQkU56TQ9s2WRziks5shOVggaJpZM4PPhr7 .

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/greatcare/pm2-zabbix/issues/19#issuecomment-328630636

-- Wysłane za pomocą K-9 Mail.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/greatcare/pm2-zabbix/issues/19#issuecomment-328647655, or mute the thread https://github.com/notifications/unsubscribe-auth/AXk91olCHMJhfih7ASVU167i24ziBCrIks5shZa1gaJpZM4PPhr7 .

ang3lwitch commented 6 years ago

Hi Robert,

Here is my result with correct command.

I have noticed when i run a "pm2 l" I do not even see the "pm2-webshell-0" listed. That is ok,it just means it is not installed or not deleted etc. I would not think that a deleted module would affect pm2-zabbix though, this at least from my observation. I could be wrong.

LOG_LEVEL=trace pm2-zabbix --monitor

{"name":"pm2-zabbix","hostname":"badhost","pid":13837,"level":30,"event":"PM2ZabbixMonitor#starting","monitor":true,"msg":"Starting PM2ZabbixMonitor (monitoring enabled: true)","time":"2017-09-11T21:46:27.157Z","v":0} {"name":"pm2-zabbix","hostname":"badhost","pid":13837,"level":20,"event":"PM2ZabbixMonitor#processMapGenerated","processMap":{"pm2-webshell-0":{"name":"pm2-webshell","status":"errored","resources":{"memory":0,"cpu":0},"restarts":15}},"msg":"Process map generated","time":"2017-09-11T21:46:27.185Z","v":0}

{"name":"pm2-zabbix","hostname":"badhost","pid":13837,"level":30,"event":"PM2ZabbixMonitor#started","msg":"PM2ZabbixMonitor started","time":"2017-09-11T21:46:27.185Z","v":0} {"name":"pm2-zabbix","hostname":"badhost","pid":13837,"level":10,"event":"PM2ZabbixMonitor#gotProcessMap","processMap":{"pm2-webshell-0":{"name":"pm2-webshell","status":"errored","resources":{"memory":0,"cpu":0},"restarts":15}},"msg":"","time":"2017-09-11T21:46:42.201Z","v":0}

{"name":"pm2-zabbix","hostname":"badhost","pid":13837,"level":20,"event":"PM2ZabbixMonitor#sendProcessList","processList":{"pm2.processes[pm2-webshell-0,status]":"errored","pm2.processes[pm2-webshell-0,cpu]":0,"pm2.processes[pm2-webshell-0,memory]":0,"pm2.processes[pm2-webshell-0,restarts]":15},"msg":"Sending process list with stats","time":"2017-09-11T21:46:42.202Z","v":0}

{"name":"pm2-zabbix","hostname":"badhost","pid":13837,"level":10,"event":"ZabbixSender#send","bin":"/usr/bin/zabbix_sender","args":["--config","/etc/zabbix/zabbix_agentd.conf","--input-file","-"],"stdIn":"badhost pm2.processes[pm2-webshell-0,status] errored\nbadhost pm2.processes[pm2-webshell-0,cpu] 0\nbadhost pm2.processes[pm2-webshell-0,memory] 0\nbadhost pm2.processes[pm2-webshell-0,restarts] 15\n","debug":false,"msg":"Executing: /usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file -","time":"2017-09-11T21:46:42.203Z","v":0}

On Mon, Sep 11, 2017 at 4:23 PM, Robert Kawecki notifications@github.com wrote:

Hi, you need to prepend the LOG_LEVEL=..., because it is an environmental variable, like so: LOG_LEVEL=trace pm2-zabbix --monitor

This should show the generated data being sent. It will not fix the problem itself, but will provide insight into what to look for in the config / on the Zabbix server.

Dnia 11 września 2017 21:16:23 CEST, ang3lwitch notifications@github.com napisał(a):

Hi Robert,

Ok, had some time to work on this. So, from a fresh install from your branch

npm install -g greatcare/pm2-zabbix

ran "pm2-zabbix --LOG_LEVEL=trace --monitor"

{"name":"pm2-zabbix","hostname":"AwesomeHost","pid": 13515,"level":50,"event":"PM2ZabbixMonitor#processListSendingError"," error":{"killed":false,"code":2,"signal":null,"cmd":"/usr/ bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file -"},"msg":"Failed to send process list with stats to server: Error: Command failed: /usr/bin/zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file -\n","time":"2017-09-11T18:50:59.016Z","v":0}

I normally would expect to see an "ok" after running pm2-zabbix but it is failing pretty much with same errors.

On Mon, Sep 11, 2017 at 3:46 AM, Robert Kawecki notifications@github.com wrote:

@jhan-aa https://github.com/jhan-aa Acknowledged. Can you try the version from master? It contains some fixes regarding path handling. npm install -g greatcare/pm2-zabbix

There are actually 2 issues on the screenshot, and only 1 is related to paths. The other one (error code 2) you will need to debug as outlined in my previous post.

If the path fix works, I'm cutting a new release.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub

<https://github.com/greatcare/pm2-zabbix/issues/19#issuecomment-328446280 , or mute the thread

https://github.com/notifications/unsubscribe-auth/ AXk91vDlxbGwSvsusWQkU56TQ9s2WRziks5shOVggaJpZM4PPhr7 .

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/greatcare/pm2-zabbix/issues/19#issuecomment-328630636

-- Wysłane za pomocą K-9 Mail.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/greatcare/pm2-zabbix/issues/19#issuecomment-328647655, or mute the thread https://github.com/notifications/unsubscribe-auth/AXk91olCHMJhfih7ASVU167i24ziBCrIks5shZa1gaJpZM4PPhr7 .

jhan-aa commented 6 years ago

@rkaw92 thanks for your update, i write the auto discover scripts by shell which already satified my requirement, but will also try how pm2-zabbix works or not