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

Handle services when their executable paths are not availabe #108

Open
ElTopo opened this issue Nov 9, 2019 · 1 comment
Open

Handle services when their executable paths are not availabe #108

ElTopo opened this issue Nov 9, 2019 · 1 comment

Comments

@ElTopo
Copy link

ElTopo commented Nov 9, 2019

Hello,

I have some services I want to monitor but their executable paths are not available (they show up in 'ps' command as "[cmd]" with square brackets) and they don't have pid files..

One example is "[mega-cmd-server]" from MEGAcmd
https://github.com/meganz/MEGAcmd

Currently $settings['services']['executables'] array only takes full path of the executable:

// Format: Label => path to executable or array containing arguments to be checked
$settings['services']['executables'] = array(
    // 'MySQLd' => '/usr/sbin/mysqld' // uncomment to enable
    // 'BuildSlave' => array('/usr/bin/python', // executable
    //                      1 => '/usr/local/bin/buildslave') // argv[1]
);

Is it possible for settings array to handle services running as "[cmd]" in 'ps'?

see: https://unix.stackexchange.com/questions/22121/what-do-the-brackets-around-processes-mean

@jrgp
Copy link
Owner

jrgp commented Jan 9, 2020

The proper fix for this would be to make linfo, rather than going off of /proc/$pid/cmdline, to grab the file path from /proc/$pid/exe instead, which would use the underlying file path, in your case the actual path your mega-cmd-server uses.

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

No branches or pull requests

2 participants