Re: [Observium] Cronjob Problem
The relevant code in poller-wrapper is :
def get_config_data():
config_cmd = ['/usr/bin/env', 'php', '%s/config_to_json.php' % ob_install_dir]
try:
proc = subprocess.Popen(config_cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE)
except:
print("ERROR: Could not execute: %s" % config_cmd)
sys.exit(2)
return proc.communicate()[0].decode('utf-8') # decode required in python3
try:
config = json.loads(get_config_data())
except:
print("ERROR: Could not load or parse observium configuration, are PATHs correct?")
sys.exit(2)
The error is referring to json.loads being unable to parse the output from config_to_json.php.
So either config_to_json.php isn’t outputting the config, or it’s not parseable, perhaps it has PHP errors in it.
Adam.
From: Reiner Marsollek reiner@marsollek.tel Sent: 05 January 2020 17:08 To: Adam Armstrong adama@memetic.org Subject: Re[2]: [Observium] Cronjob Problem
Hello,
yes it is a Debian variant. The cronjob is started with root. But this error appears with the path.
Reiner
------ Originalnachricht ------
Von: "Adam Armstrong" <adama@memetic.org mailto:adama@memetic.org >
An: "Reiner Marsollek via observium" <observium@observium.org mailto:observium@observium.org >
Cc: "Reiner Marsollek" <reiner@marsollek.tel mailto:reiner@marsollek.tel >
Gesendet: 05.01.2020 17:06:35
Betreff: Re: [Observium] Cronjob Problem
Is this on a Debian variant?
It's possible the variant is different in such a way that the script doesn't cater for.
Still, it's likely either permissions, or the PHP interpreter is behaving oddly somehow.
Running the wrapper as the user that executes the from jobs works? (Running it as root for diagnostic purposes is worthless, and will break your installation's file permissions)
Adam.
Sent from BlueMail http://www.bluemail.me/r?b=15726
On 5 Jan 2020, at 14:56, Reiner Marsollek via observium <observium@observium.org mailto:observium@observium.org > wrote:
I have installed it with the install script on a raspberry pi3.
Am 5. Januar 2020 3:13:30 nachm. schrieb Adam Armstrong via observium <observium@observium.org mailto:observium@observium.org >:
What is this installed on? Did you follow the install guide or use the install script?
This is likely either permissions or the PHP interpreter not running the config generator.
Adam.
Sent from BlueMail http://www.bluemail.me/r?b=15726
On 5 Jan 2020, at 13:41, Reiner Marsollek via observium < observium@observium.org mailto:observium@observium.org > wrote:
Same Problem when i start the cron manuel. All pathes in config are correct!
Ausgabe des Befehls cd /opt/observium/ && ./poller-wrapper.py ..
ERROR: Could not load or parse observium configuration, are PATHs correct?
------ Originalnachricht ------
Von: "Ray Poorman via observium" < observium@observium.org mailto:observium@observium.org >
An: "Observium" < observium@observium.org mailto:observium@observium.org >
Cc: "Ray Poorman" < rpoorman@cssnw.com mailto:rpoorman@cssnw.com >
Gesendet: 04.01.2020 21:39:59
Betreff: Re: [Observium] Cronjob Problem
Note where the cd is to move to the correct dir in the command
[root@observium observium]# cat /etc/cron.d/observium
33 */3 * * * Useracct cd /opt/observium/ && ./discovery.php -h all >> /dev/null 2>&1
*/5 * * * * Useracct cd /opt/observium/ && ./discovery.php -h new >> /dev/null 2>&1
# */5 * * * * Useracct cd /opt/observium/ && ./poller.php -h all >> /dev/null 2>&1
*/5 * * * * Useracct /opt/observium/poller-wrapper.py >> /dev/null 2>&1
*/5 * * * * Useracct /opt/observium/poll-billing.php >> /dev/null 2>&1
01 * * * * Useracct /opt/observium/billing-calculate.php >> /dev/null 2>&1
# Run housekeeping script daily for syslog, eventlog and alert log
13 5 * * * Useracct /opt/observium/housekeeping.php -sel >> /dev/null 2>&1
# Run housekeeping script daily for rrds, ports, orphaned entries in the database and performance data
47 4 * * * Useracct /opt/observium/housekeeping.php -rptb >> /dev/null 2>&1
-- Ray Poorman, CTO
CSS Integration & Communications
1911 C St
Bellingham WA 98225
360-671-4878
On January 4, 2020 at 12:39:06 PM, Ray Poorman (rpoorman@cssnw.com mailto:rpoorman@cssnw.com ) wrote:
When you run the job what directory are you sitting in.. are there absolute paths? if you are say in /root and run /opt/observium/poller.php does it fail I bet it does or it doesn’t know where config file is.
Are these set right?
### Locations
$config['install_dir'] = "/opt/observium";
$config['html_dir'] = $config['install_dir'] . "/html";
$config['rrd_dir'] = $config['install_dir'] . "/rrd";
$config['log_file'] = $config['install_dir'] . "/observium.log”;
Here is my /etc/cron.d/observium file
-- Ray Poorman, CTO
CSS Integration & Communications
1911 C St
Bellingham WA 98225
360-671-4878
On January 4, 2020 at 11:27:11 AM, Reiner Marsollek via observium (observium@observium.org mailto:observium@observium.org ) wrote:
Hello,
here's the problem. If I start the poller-wrapper manually in the shell it works without problems. But if it is started by the cronjob, I get the following error message: ERROR: Could not load or parse observium configuration, are PATHs correct? Does anyone know the problem and how to fix it?
Reiner
_______________________________________________ observium mailing list observium@observium.org mailto:observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
_____
observium mailing list observium@observium.org mailto:observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
_______________________________________________
observium mailing list
observium@observium.org mailto:observium%40observium.org
http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
_____
observium mailing list observium@observium.org mailto:observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
Fine, but that doesn't solve my problem either.
------ Originalnachricht ------ Von: "adama--- via observium" observium@observium.org An: "'Observium'" observium@observium.org Cc: adama@observium.org Gesendet: 05.01.2020 21:21:57 Betreff: Re: [Observium] Cronjob Problem
The relevant code in poller-wrapper is :
def get_config_data():
config_cmd = ['/usr/bin/env', 'php', '%s/config_to_json.php' %
ob_install_dir]
try: proc = subprocess.Popen(config_cmd, stdout=subprocess.PIPE,
stdin=subprocess.PIPE)
except: print("ERROR: Could not execute: %s" % config_cmd) sys.exit(2) return proc.communicate()[0].decode('utf-8') # decode required in
python3
try:
config = json.loads(get_config_data())
except:
print("ERROR: Could not load or parse observium configuration, are
PATHs correct?")
sys.exit(2)
The error is referring to json.loads being unable to parse the output from config_to_json.php.
So either config_to_json.php isn’t outputting the config, or it’s not parseable, perhaps it has PHP errors in it.
Adam.
From: Reiner Marsollek reiner@marsollek.tel Sent: 05 January 2020 17:08 To: Adam Armstrong adama@memetic.org Subject: Re[2]: [Observium] Cronjob Problem
Hello,
yes it is a Debian variant. The cronjob is started with root. But this error appears with the path.
Reiner
------ Originalnachricht ------
Von: "Adam Armstrong" adama@memetic.org
An: "Reiner Marsollek via observium" observium@observium.org
Cc: "Reiner Marsollek" reiner@marsollek.tel
Gesendet: 05.01.2020 17:06:35
Betreff: Re: [Observium] Cronjob Problem
Is this on a Debian variant?
It's possible the variant is different in such a way that the script doesn't cater for.
Still, it's likely either permissions, or the PHP interpreter is behaving oddly somehow.
Running the wrapper as the user that executes the from jobs works? (Running it as root for diagnostic purposes is worthless, and will break your installation's file permissions)
Adam.
Sent from BlueMail http://www.bluemail.me/r?b=15726
On 5 Jan 2020, at 14:56, Reiner Marsollek via observium observium@observium.org wrote:
I have installed it with the install script on a raspberry pi3.
Am 5. Januar 2020 3:13:30 nachm. schrieb Adam Armstrong via observium observium@observium.org:
What is this installed on? Did you follow the install guide or use the install script?
This is likely either permissions or the PHP interpreter not running the config generator.
Adam.
Sent from BlueMail http://www.bluemail.me/r?b=15726
On 5 Jan 2020, at 13:41, Reiner Marsollek via observium < observium@observium.org> wrote:
Same Problem when i start the cron manuel. All pathes in config are correct!
Ausgabe des Befehls cd /opt/observium/ && ./poller-wrapper.py ..
ERROR: Could not load or parse observium configuration, are PATHs correct?
------ Originalnachricht ------
Von: "Ray Poorman via observium" < observium@observium.org>
An: "Observium" < observium@observium.org>
Cc: "Ray Poorman" < rpoorman@cssnw.com>
Gesendet: 04.01.2020 21:39:59
Betreff: Re: [Observium] Cronjob Problem
Note where the cd is to move to the correct dir in the command
[root@observium observium]# cat /etc/cron.d/observium
33 */3 * * * Useracct cd /opt/observium/ && ./discovery.php -h all >> /dev/null 2>&1
*/5 * * * * Useracct cd /opt/observium/ && ./discovery.php -h new >> /dev/null 2>&1
# */5 * * * * Useracct cd /opt/observium/ && ./poller.php -h all >> /dev/null 2>&1
*/5 * * * * Useracct /opt/observium/poller-wrapper.py >> /dev/null 2>&1
*/5 * * * * Useracct /opt/observium/poll-billing.php >> /dev/null 2>&1
01 * * * * Useracct /opt/observium/billing-calculate.php >> /dev/null 2>&1
# Run housekeeping script daily for syslog, eventlog and alert log
13 5 * * * Useracct /opt/observium/housekeeping.php -sel >> /dev/null 2>&1
# Run housekeeping script daily for rrds, ports, orphaned entries in the database and performance data
47 4 * * * Useracct /opt/observium/housekeeping.php -rptb >> /dev/null 2>&1
-- Ray Poorman, CTO
CSS Integration & Communications
1911 C St
Bellingham WA 98225
360-671-4878
On January 4, 2020 at 12:39:06 PM, Ray Poorman (rpoorman@cssnw.com) wrote:
>When you run the job what directory are you sitting in.. are >there absolute paths? if you are say in /root and run >/opt/observium/poller.php does it fail I bet it does or it >doesn’t know where config file is. > > > >Are these set right? > >### Locations > >$config['install_dir'] = "/opt/observium"; > >$config['html_dir'] = $config['install_dir'] . "/html"; > >$config['rrd_dir'] = $config['install_dir'] . "/rrd"; > >$config['log_file'] = $config['install_dir'] . >"/observium.log”; > > > > > >Here is my /etc/cron.d/observium file > > > > > >-- >Ray Poorman, CTO > >CSS Integration & Communications > >1911 C St > >Bellingham WA 98225 > >360-671-4878 > > > >On January 4, 2020 at 11:27:11 AM, Reiner Marsollek via observium >(observium@observium.org) wrote: > >> >> >>Hello, >> >> >>here's the problem. If I start the poller-wrapper manually in >>the shell it works without problems. But if it is started by the >>cronjob, I get the following error message: >>ERROR: Could not load or parse observium configuration, are >>PATHs correct? >>Does anyone know the problem and how to fix it? >> >> >> >>Reiner >> >>_______________________________________________ >>observium mailing list >>observium@observium.org >>http://postman.memetic.org/cgi-bin/mailman/listinfo/observium >>
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
observium mailing list
observium@observium.org mailto:observium%40observium.org
http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
participants (2)
-
adama@observium.org
-
Reiner Marsollek