running observium on freebsd
Hi All,
this is a random question, has anyone got observium running correctly on freebsd?
managed to get it all setup and running, panels fine, add devices fine, poll device manually, etc
only issue I’m having is i can’t get the cronjob working for every 5mins?
i can see from the cron log in /var/log its running the poller correctly
Oct 18 04:05:00 observium /usr/sbin/cron[49554]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:10:00 observium /usr/sbin/cron[50385]: (root) CMD (/usr/libexec/atrun) Oct 18 04:10:00 observium /usr/sbin/cron[50387]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:15:00 observium /usr/sbin/cron[51227]: (root) CMD (/usr/libexec/atrun) Oct 18 04:15:00 observium /usr/sbin/cron[51228]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:20:00 observium /usr/sbin/cron[52076]: (root) CMD (/usr/libexec/atrun) Oct 18 04:20:00 observium /usr/sbin/cron[52079]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:25:00 observium /usr/sbin/cron[52917]: (root) CMD (/usr/libexec/atrun) Oct 18 04:25:00 observium /usr/sbin/cron[52918]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:30:00 observium /usr/sbin/cron[53752]: (root) CMD (/usr/libexec/atrun) Oct 18 04:30:00 observium /usr/sbin/cron[53753]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null)
however no data gets inserted into the db, but if i run the command manually as root, it inserts stuff fine?
the only thing i can think of is the php is running apache which then runs as www not root
would this have an issue maybe?
regards
Simon
Hi Simon,
I'm running Observium in a Freebsd-10, no problems here.
Cron is running as root:
# cat /etc/crontab
# /etc/crontab - root's crontab for FreeBSD # # $FreeBSD: releng/10.3/etc/crontab 194170 2009-06-14 06:37:19Z brian $ # SHELL=/bin/sh PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin # #minute hour mday month wday who command # # Observium - poller 33 */6 * * * root /opt/observium/discovery.php -h all > /dev/null 2>&1 */5 * * * * root /opt/observium/discovery.php -h new > /dev/null 2>&1 */5 * * * * root /opt/observium/poller-wrapper.py 16 > /dev/null 2>&1 # # Observium - billing */5 * * * * root /opt/observium/poll-billing.php > /dev/null 2>&1 01 * * * * root /opt/observium/billing-calculate.php > /dev/null 2>&1
Permissions on rrd folder:
# ls -la | grep rrd drwxr-xr-x 58 root www 2048 Oct 18 20:10 rrd
You can output poller to a file, for debug purposes (on your crontab file):
#*/5 * * * * root /opt/observium/poller-wrapper.py 16 > /opt/observium/logs/poller.log
Regards,
2016-10-19 13:28 GMT-02:00 Simon Smith simonsmith5521@gmail.com:
Hi All,
this is a random question, has anyone got observium running correctly on freebsd?
managed to get it all setup and running, panels fine, add devices fine, poll device manually, etc
only issue I’m having is i can’t get the cronjob working for every 5mins?
i can see from the cron log in /var/log its running the poller correctly
Oct 18 04:05:00 observium /usr/sbin/cron[49554]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:10:00 observium /usr/sbin/cron[50385]: (root) CMD (/usr/libexec/atrun) Oct 18 04:10:00 observium /usr/sbin/cron[50387]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:15:00 observium /usr/sbin/cron[51227]: (root) CMD (/usr/libexec/atrun) Oct 18 04:15:00 observium /usr/sbin/cron[51228]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:20:00 observium /usr/sbin/cron[52076]: (root) CMD (/usr/libexec/atrun) Oct 18 04:20:00 observium /usr/sbin/cron[52079]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:25:00 observium /usr/sbin/cron[52917]: (root) CMD (/usr/libexec/atrun) Oct 18 04:25:00 observium /usr/sbin/cron[52918]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:30:00 observium /usr/sbin/cron[53752]: (root) CMD (/usr/libexec/atrun) Oct 18 04:30:00 observium /usr/sbin/cron[53753]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null)
however no data gets inserted into the db, but if i run the command manually as root, it inserts stuff fine?
the only thing i can think of is the php is running apache which then runs as www not root
would this have an issue maybe?
regards
Simon _______________________________________________ observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
Issues with scripts that run fine when invoked manually from the command line but fail when run by cron almost always seem to come down to an issue with the $PATH in cron's environment.
Try removing the STDOUT redirect to /dev/null on the cronjob, and after it runs again, check /var/mail/root for the output of the cronjob (or just run `mail` as root). Whatever error is thrown when running from within cron's environment should then be there. Alternatively, you can change the redirect to point to /tmp/debugcron.txt or something and check that file for the output, as well. You may have to redirect both STDERR and STDOUT to the file... e.g.:
*/5 * * * * root /usr/local/www/observium/poller-wrapper.py 2 2>&1 >> /tmp/debugcron.txt
On 10/19/2016 11:28 AM, Simon Smith wrote:
Hi All,
this is a random question, has anyone got observium running correctly on freebsd?
managed to get it all setup and running, panels fine, add devices fine, poll device manually, etc
only issue I’m having is i can’t get the cronjob working for every 5mins?
i can see from the cron log in /var/log its running the poller correctly
Oct 18 04:05:00 observium /usr/sbin/cron[49554]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:10:00 observium /usr/sbin/cron[50385]: (root) CMD (/usr/libexec/atrun) Oct 18 04:10:00 observium /usr/sbin/cron[50387]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:15:00 observium /usr/sbin/cron[51227]: (root) CMD (/usr/libexec/atrun) Oct 18 04:15:00 observium /usr/sbin/cron[51228]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:20:00 observium /usr/sbin/cron[52076]: (root) CMD (/usr/libexec/atrun) Oct 18 04:20:00 observium /usr/sbin/cron[52079]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:25:00 observium /usr/sbin/cron[52917]: (root) CMD (/usr/libexec/atrun) Oct 18 04:25:00 observium /usr/sbin/cron[52918]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:30:00 observium /usr/sbin/cron[53752]: (root) CMD (/usr/libexec/atrun) Oct 18 04:30:00 observium /usr/sbin/cron[53753]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null)
however no data gets inserted into the db, but if i run the command manually as root, it inserts stuff fine?
the only thing i can think of is the php is running apache which then runs as www not root
would this have an issue maybe?
regards
Simon _______________________________________________ observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
Hi
thanks all for help but still having no luck!
its creating the temp txt file, but the files BLANK and EMPTY and STILL no data being inserted?
also when i run the command with the 2>&1 after I’m getting 'Ambiguous output redirect.’ as the output when run manually?
any more ideas?
regards
Simon
On 19 Oct 2016, at 4:58 pm, Joseph Zancocchio joseph@nyi.net wrote:
Issues with scripts that run fine when invoked manually from the command line but fail when run by cron almost always seem to come down to an issue with the $PATH in cron's environment.
Try removing the STDOUT redirect to /dev/null on the cronjob, and after it runs again, check /var/mail/root for the output of the cronjob (or just run `mail` as root). Whatever error is thrown when running from within cron's environment should then be there. Alternatively, you can change the redirect to point to /tmp/debugcron.txt or something and check that file for the output, as well. You may have to redirect both STDERR and STDOUT to the file... e.g.:
*/5 * * * * root /usr/local/www/observium/poller-wrapper.py 2 2>&1 >> /tmp/debugcron.txt On 10/19/2016 11:28 AM, Simon Smith wrote:
Hi All,
this is a random question, has anyone got observium running correctly on freebsd?
managed to get it all setup and running, panels fine, add devices fine, poll device manually, etc
only issue I’m having is i can’t get the cronjob working for every 5mins?
i can see from the cron log in /var/log its running the poller correctly
Oct 18 04:05:00 observium /usr/sbin/cron[49554]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:10:00 observium /usr/sbin/cron[50385]: (root) CMD (/usr/libexec/atrun) Oct 18 04:10:00 observium /usr/sbin/cron[50387]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:15:00 observium /usr/sbin/cron[51227]: (root) CMD (/usr/libexec/atrun) Oct 18 04:15:00 observium /usr/sbin/cron[51228]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:20:00 observium /usr/sbin/cron[52076]: (root) CMD (/usr/libexec/atrun) Oct 18 04:20:00 observium /usr/sbin/cron[52079]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:25:00 observium /usr/sbin/cron[52917]: (root) CMD (/usr/libexec/atrun) Oct 18 04:25:00 observium /usr/sbin/cron[52918]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:30:00 observium /usr/sbin/cron[53752]: (root) CMD (/usr/libexec/atrun) Oct 18 04:30:00 observium /usr/sbin/cron[53753]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null)
however no data gets inserted into the db, but if i run the command manually as root, it inserts stuff fine?
the only thing i can think of is the php is running apache which then runs as www not root
would this have an issue maybe?
regards
Simon _______________________________________________ observium mailing list observium@observium.org mailto:observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
1995 called and asked for its choice of OS back. :p
I assume this is probably weirdy permissions stuff. Didn't Joe holden reply yet? I know he's run on freebsd recently. He's peculiar like that too. :D
Adam.
Sent from BlueMail
On 21 Oct 2016, 10:30, at 10:30, Simon Smith simonsmith5521@gmail.com wrote:
Hi
thanks all for help but still having no luck!
its creating the temp txt file, but the files BLANK and EMPTY and STILL no data being inserted?
also when i run the command with the 2>&1 after I’m getting 'Ambiguous output redirect.’ as the output when run manually?
any more ideas?
regards
Simon
On 19 Oct 2016, at 4:58 pm, Joseph Zancocchio joseph@nyi.net wrote:
Issues with scripts that run fine when invoked manually from the
command line but fail when run by cron almost always seem to come down to an issue with the $PATH in cron's environment.
Try removing the STDOUT redirect to /dev/null on the cronjob, and
after it runs again, check /var/mail/root for the output of the cronjob (or just run `mail` as root). Whatever error is thrown when running from within cron's environment should then be there. Alternatively, you can change the redirect to point to /tmp/debugcron.txt or something and check that file for the output, as well. You may have to redirect both STDERR and STDOUT to the file... e.g.:
*/5 * * * * root
/usr/local/www/observium/poller-wrapper.py 2 2>&1 >> /tmp/debugcron.txt
On 10/19/2016 11:28 AM, Simon Smith wrote:
Hi All,
this is a random question, has anyone got observium running
correctly on freebsd?
managed to get it all setup and running, panels fine, add devices
fine, poll device manually, etc
only issue I’m having is i can’t get the cronjob working for every
5mins?
i can see from the cron log in /var/log its running the poller
correctly
Oct 18 04:05:00 observium /usr/sbin/cron[49554]: (root) CMD
(/opt/observium/poller-wrapper.py 2 >> /dev/null)
Oct 18 04:10:00 observium /usr/sbin/cron[50385]: (root) CMD
(/usr/libexec/atrun)
Oct 18 04:10:00 observium /usr/sbin/cron[50387]: (root) CMD
(/opt/observium/poller-wrapper.py 2 >> /dev/null)
Oct 18 04:15:00 observium /usr/sbin/cron[51227]: (root) CMD
(/usr/libexec/atrun)
Oct 18 04:15:00 observium /usr/sbin/cron[51228]: (root) CMD
(/opt/observium/poller-wrapper.py 2 >> /dev/null)
Oct 18 04:20:00 observium /usr/sbin/cron[52076]: (root) CMD
(/usr/libexec/atrun)
Oct 18 04:20:00 observium /usr/sbin/cron[52079]: (root) CMD
(/opt/observium/poller-wrapper.py 2 >> /dev/null)
Oct 18 04:25:00 observium /usr/sbin/cron[52917]: (root) CMD
(/usr/libexec/atrun)
Oct 18 04:25:00 observium /usr/sbin/cron[52918]: (root) CMD
(/opt/observium/poller-wrapper.py 2 >> /dev/null)
Oct 18 04:30:00 observium /usr/sbin/cron[53752]: (root) CMD
(/usr/libexec/atrun)
Oct 18 04:30:00 observium /usr/sbin/cron[53753]: (root) CMD
(/opt/observium/poller-wrapper.py 2 >> /dev/null)
however no data gets inserted into the db, but if i run the command
manually as root, it inserts stuff fine?
the only thing i can think of is the php is running apache which
then runs as www not root
would this have an issue maybe?
regards
Simon _______________________________________________ observium mailing list observium@observium.org mailto:observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
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 http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
Paths to binary are weird in Freebsd, I had issues with that, have to create some symlinks. Try to run cron lines by hand, one by one.
2016-10-21 10:31 GMT-02:00 Adam Armstrong adama@memetic.org:
1995 called and asked for its choice of OS back. :p
I assume this is probably weirdy permissions stuff. Didn't Joe holden reply yet? I know he's run on freebsd recently. He's peculiar like that too. :D
Adam.
Sent from BlueMail
On 21 Oct 2016, at 10:30, Simon Smith simonsmith5521@gmail.com wrote:
Hi
thanks all for help but still having no luck!
its creating the temp txt file, but the files BLANK and EMPTY and STILL no data being inserted?
also when i run the command with the 2>&1 after I’m getting 'Ambiguous output redirect.’ as the output when run manually?
any more ideas?
regards
Simon
On 19 Oct 2016, at 4:58 pm, Joseph Zancocchio joseph@nyi.net wrote:
Issues with scripts that run fine when invoked manually from the command line but fail when run by cron almost always seem to come down to an issue with the $PATH in cron's environment.
Try removing the STDOUT redirect to /dev/null on the cronjob, and after it runs again, check /var/mail/root for the output of the cronjob (or just run `mail` as root). Whatever error is thrown when running from within cron's environment should then be there. Alternatively, you can change the redirect to point to /tmp/debugcron.txt or something and check that file for the output, as well. You may have to redirect both STDERR and STDOUT to the file... e.g.:
*/5 * * * * root /usr/local/www/observium/poller-wrapper.py 2 2>&1 >> /tmp/debugcron.txt
On 10/19/2016 11:28 AM, Simon Smith wrote:
Hi All,
this is a random question, has anyone got observium running correctly on freebsd?
managed to get it all setup and running, panels fine, add devices fine, poll device manually, etc
only issue I’m having is i can’t get the cronjob working for every 5mins?
i can see from the cron log in /var/log its running the poller correctly
Oct 18 04:05:00 observium /usr/sbin/cron[49554]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:10:00 observium /usr/sbin/cron[50385]: (root) CMD (/usr/libexec/atrun) Oct 18 04:10:00 observium /usr/sbin/cron[50387]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:15:00 observium /usr/sbin/cron[51227]: (root) CMD (/usr/libexec/atrun) Oct 18 04:15:00 observium /usr/sbin/cron[51228]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:20:00 observium /usr/sbin/cron[52076]: (root) CMD (/usr/libexec/atrun) Oct 18 04:20:00 observium /usr/sbin/cron[52079]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:25:00 observium /usr/sbin/cron[52917]: (root) CMD (/usr/libexec/atrun) Oct 18 04:25:00 observium /usr/sbin/cron[52918]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:30:00 observium /usr/sbin/cron[53752]: (root) CMD (/usr/libexec/atrun) Oct 18 04:30:00 observium /usr/sbin/cron[53753]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null)
however no data gets inserted into the db, but if i run the command manually as root, it inserts stuff fine?
the only thing i can think of is the php is running apache which then runs as www not root
would this have an issue maybe?
regards
Simon _______________________________________________ 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 http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
Also, I had to specify the path of multiple files in config.php:
$config['svn'] = "/usr/local/bin/svn"; $config['git'] = "/usr/local/bin/git"; $config['mtr'] = "/usr/local/sbin/mtr"; $config['fping'] = "/usr/local/sbin/fping"; $config['fping6'] = "/usr/local/sbin/fping6"; $config['neato'] = "/usr/local/bin/neato"; $config['nmap'] = "/usr/local/bin/nmap"; $config['rrdtool'] = "/usr/local/bin/rrdtool"; $config['snmpget'] = "/usr/local/bin/snmpget"; $config['snmpbulkget'] = "/usr/local/bin/snmpbulkget"; $config['snmpwalk'] = "/usr/local/bin/snmpwalk"; $config['snmpbulkwalk'] = "/usr/local/bin/snmpbulkwalk"; $config['snmptranslate'] = "/usr/local/bin/snmptranslate"; $config['unflatten'] = "/usr/local/bin/unflatten";
2016-10-21 12:01 GMT-02:00 Eduardo Schoedler listas@esds.com.br:
Paths to binary are weird in Freebsd, I had issues with that, have to create some symlinks. Try to run cron lines by hand, one by one.
2016-10-21 10:31 GMT-02:00 Adam Armstrong adama@memetic.org:
1995 called and asked for its choice of OS back. :p
I assume this is probably weirdy permissions stuff. Didn't Joe holden reply yet? I know he's run on freebsd recently. He's peculiar like that too. :D
Adam.
Sent from BlueMail
On 21 Oct 2016, at 10:30, Simon Smith simonsmith5521@gmail.com wrote:
Hi
thanks all for help but still having no luck!
its creating the temp txt file, but the files BLANK and EMPTY and STILL no data being inserted?
also when i run the command with the 2>&1 after I’m getting 'Ambiguous output redirect.’ as the output when run manually?
any more ideas?
regards
Simon
On 19 Oct 2016, at 4:58 pm, Joseph Zancocchio joseph@nyi.net wrote:
Issues with scripts that run fine when invoked manually from the command line but fail when run by cron almost always seem to come down to an issue with the $PATH in cron's environment.
Try removing the STDOUT redirect to /dev/null on the cronjob, and after it runs again, check /var/mail/root for the output of the cronjob (or just run `mail` as root). Whatever error is thrown when running from within cron's environment should then be there. Alternatively, you can change the redirect to point to /tmp/debugcron.txt or something and check that file for the output, as well. You may have to redirect both STDERR and STDOUT to the file... e.g.:
*/5 * * * * root /usr/local/www/observium/poller-wrapper.py 2 2>&1 >> /tmp/debugcron.txt
On 10/19/2016 11:28 AM, Simon Smith wrote:
Hi All,
this is a random question, has anyone got observium running correctly on freebsd?
managed to get it all setup and running, panels fine, add devices fine, poll device manually, etc
only issue I’m having is i can’t get the cronjob working for every 5mins?
i can see from the cron log in /var/log its running the poller correctly
Oct 18 04:05:00 observium /usr/sbin/cron[49554]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:10:00 observium /usr/sbin/cron[50385]: (root) CMD (/usr/libexec/atrun) Oct 18 04:10:00 observium /usr/sbin/cron[50387]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:15:00 observium /usr/sbin/cron[51227]: (root) CMD (/usr/libexec/atrun) Oct 18 04:15:00 observium /usr/sbin/cron[51228]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:20:00 observium /usr/sbin/cron[52076]: (root) CMD (/usr/libexec/atrun) Oct 18 04:20:00 observium /usr/sbin/cron[52079]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:25:00 observium /usr/sbin/cron[52917]: (root) CMD (/usr/libexec/atrun) Oct 18 04:25:00 observium /usr/sbin/cron[52918]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:30:00 observium /usr/sbin/cron[53752]: (root) CMD (/usr/libexec/atrun) Oct 18 04:30:00 observium /usr/sbin/cron[53753]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null)
however no data gets inserted into the db, but if i run the command manually as root, it inserts stuff fine?
the only thing i can think of is the php is running apache which then runs as www not root
would this have an issue maybe?
regards
Simon _______________________________________________ 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 http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
-- Eduardo Schoedler
Hi,
my binaries are all set the same as urs and still no luck :(
if i run '/opt/observium/poller-wrapper.py 2' manually it works fine :)
but again the ‘/etc/crontab', and 'crontab -e' just doesn’t work and no idea why?
the only thing i can think of it the freebsd I’m running is inside a jail on freenas
as i wanted to move our monitoring off our servers to our nas so then when we restart servers, etc, we have no downtime on monitoring
regards
Simon
On 21 Oct 2016, at 3:03 pm, Eduardo Schoedler listas@esds.com.br wrote:
Also, I had to specify the path of multiple files in config.php:
$config['svn'] = "/usr/local/bin/svn"; $config['git'] = "/usr/local/bin/git"; $config['mtr'] = "/usr/local/sbin/mtr"; $config['fping'] = "/usr/local/sbin/fping"; $config['fping6'] = "/usr/local/sbin/fping6"; $config['neato'] = "/usr/local/bin/neato"; $config['nmap'] = "/usr/local/bin/nmap"; $config['rrdtool'] = "/usr/local/bin/rrdtool"; $config['snmpget'] = "/usr/local/bin/snmpget"; $config['snmpbulkget'] = "/usr/local/bin/snmpbulkget"; $config['snmpwalk'] = "/usr/local/bin/snmpwalk"; $config['snmpbulkwalk'] = "/usr/local/bin/snmpbulkwalk"; $config['snmptranslate'] = "/usr/local/bin/snmptranslate"; $config['unflatten'] = "/usr/local/bin/unflatten";
2016-10-21 12:01 GMT-02:00 Eduardo Schoedler listas@esds.com.br:
Paths to binary are weird in Freebsd, I had issues with that, have to create some symlinks. Try to run cron lines by hand, one by one.
2016-10-21 10:31 GMT-02:00 Adam Armstrong adama@memetic.org:
1995 called and asked for its choice of OS back. :p
I assume this is probably weirdy permissions stuff. Didn't Joe holden reply yet? I know he's run on freebsd recently. He's peculiar like that too. :D
Adam.
Sent from BlueMail
On 21 Oct 2016, at 10:30, Simon Smith simonsmith5521@gmail.com wrote:
Hi
thanks all for help but still having no luck!
its creating the temp txt file, but the files BLANK and EMPTY and STILL no data being inserted?
also when i run the command with the 2>&1 after I’m getting 'Ambiguous output redirect.’ as the output when run manually?
any more ideas?
regards
Simon
On 19 Oct 2016, at 4:58 pm, Joseph Zancocchio joseph@nyi.net wrote:
Issues with scripts that run fine when invoked manually from the command line but fail when run by cron almost always seem to come down to an issue with the $PATH in cron's environment.
Try removing the STDOUT redirect to /dev/null on the cronjob, and after it runs again, check /var/mail/root for the output of the cronjob (or just run `mail` as root). Whatever error is thrown when running from within cron's environment should then be there. Alternatively, you can change the redirect to point to /tmp/debugcron.txt or something and check that file for the output, as well. You may have to redirect both STDERR and STDOUT to the file... e.g.:
*/5 * * * * root /usr/local/www/observium/poller-wrapper.py 2 2>&1 >> /tmp/debugcron.txt
On 10/19/2016 11:28 AM, Simon Smith wrote:
Hi All,
this is a random question, has anyone got observium running correctly on freebsd?
managed to get it all setup and running, panels fine, add devices fine, poll device manually, etc
only issue I’m having is i can’t get the cronjob working for every 5mins?
i can see from the cron log in /var/log its running the poller correctly
Oct 18 04:05:00 observium /usr/sbin/cron[49554]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:10:00 observium /usr/sbin/cron[50385]: (root) CMD (/usr/libexec/atrun) Oct 18 04:10:00 observium /usr/sbin/cron[50387]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:15:00 observium /usr/sbin/cron[51227]: (root) CMD (/usr/libexec/atrun) Oct 18 04:15:00 observium /usr/sbin/cron[51228]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:20:00 observium /usr/sbin/cron[52076]: (root) CMD (/usr/libexec/atrun) Oct 18 04:20:00 observium /usr/sbin/cron[52079]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:25:00 observium /usr/sbin/cron[52917]: (root) CMD (/usr/libexec/atrun) Oct 18 04:25:00 observium /usr/sbin/cron[52918]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null) Oct 18 04:30:00 observium /usr/sbin/cron[53752]: (root) CMD (/usr/libexec/atrun) Oct 18 04:30:00 observium /usr/sbin/cron[53753]: (root) CMD (/opt/observium/poller-wrapper.py 2 >> /dev/null)
however no data gets inserted into the db, but if i run the command manually as root, it inserts stuff fine?
the only thing i can think of is the php is running apache which then runs as www not root
would this have an issue maybe?
regards
Simon _______________________________________________ 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 http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
-- Eduardo Schoedler
-- Eduardo Schoedler _______________________________________________ observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
participants (4)
-
Adam Armstrong
-
Eduardo Schoedler
-
Joseph Zancocchio
-
Simon Smith