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

Error: You seems to run on a Mac OS, node-usage can't get monitor data #3

Closed
ghost opened this issue Jun 12, 2013 · 12 comments
Closed

Comments

@ghost
Copy link

ghost commented Jun 12, 2013

Hi,

If I understand, I need to install Monit first on my MacBook (10.8 Mountain Lion) to use pm2 monit ?

@Unitech
Copy link
Owner

Unitech commented Jun 17, 2013

Hello, thanks for reporting issues.

PM2 is using the module https://github.com/arunoda/node-usage to retrieve monitoring data for a specific process, unfortunately it's still not compatible with Mac OSx, feel free to pull request.

But I would like to tell that pm2 is a production module, who should be mainly used on servers

Cheers !

@jhurliman
Copy link
Contributor

I sent a pull request to node-usage (arunoda/node-usage#5) to address this. Once it is merged in and a new version is published to npm, does anything need to change in pm2?

@Unitech
Copy link
Owner

Unitech commented Jun 27, 2013

Excellent, I will add a way to update pm2 smoothly

@breaklee
Copy link

i'm using pm2 version 0.4.7. and i've installed usage(node-usage)..
but it can't operate. pm2 monit on macox.
how can i use it?

@breaklee
Copy link

and my 'usage' version is 0.3.5

@arunoda
Copy link

arunoda commented Jun 27, 2013

Node Usage has been patched with @jhurliman 's pull request.
And published to npm as 0.3.6

Hope now pm2 can be used in mac too :)

@Unitech
Copy link
Owner

Unitech commented Jun 27, 2013

Ty
I've updated pm2 to 0.4.8

Here is the update procedure for people who wants to upgrade to newest version : https://github.com/Unitech/pm2#updating-pm2-and-keeping-processes-alive

@ghost
Copy link
Author

ghost commented Jun 27, 2013

I think I got the same error :/

Did I need to install Monit on my Mac ? or node-usage do the same think like Monit ?

$ pm2 monit

/usr/local/lib/node_modules/pm2/lib/Monit.js:27
    throw new Error('You seems to run on a Mac OS, node-usage can\'t get monit
          ^
Error: You seems to run on a Mac OS, node-usage can't get monitor data
    at Object.Monit.init (/usr/local/lib/node_modules/pm2/lib/Monit.js:27:11)
    at /usr/local/lib/node_modules/pm2/bin/pm2:588:11
    at /usr/local/lib/node_modules/pm2/lib/Satan.js:152:5
    at /usr/local/lib/node_modules/pm2/node_modules/axon-rpc/lib/client.js:43:10
    at Parser.onmessage (/usr/local/lib/node_modules/pm2/node_modules/axon/lib/sockets/req.js:65:8)
    at Parser.frameBody (/usr/local/lib/node_modules/pm2/node_modules/axon/lib/parser.js:106:10)
    at Parser.write (/usr/local/lib/node_modules/pm2/node_modules/axon/lib/parser.js:50:13)
    at Parser.frameHeader (/usr/local/lib/node_modules/pm2/node_modules/axon/lib/parser.js:81:30)
    at Parser.write (/usr/local/lib/node_modules/pm2/node_modules/axon/lib/parser.js:49:36)
    at Socket.EventEmitter.emit (events.js:95:17)

@jhurliman
Copy link
Contributor

@igorissen, the short answer is that the daemon needs to be run as root on OSX. Run pm2 kill, then sudo pm2 start yourapp.json. I've submitted a pull request at #39 to catch this issue and print out a helpful error message instead of the outdated warning about node-usage not working on Mac OS.

@jhurliman
Copy link
Contributor

Just a heads up, I submitted another pull request to node-usage that allows it to run on OSX without root privileges (arunoda/node-usage#7). If that gets merged, I'll modify my pull request for pm2 to not require the daemon to be run as root on OSX.

@jhurliman
Copy link
Contributor

node-usage 0.3.7 is out, and my pull request has been updated.

@ghost
Copy link
Author

ghost commented Jul 8, 2013

It works now ! Thank you.

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

No branches or pull requests

4 participants