You are not logged in.
Pages: 1
Hi,
I' would like to get glpi receivers to work automatically to have instant ticket overview.
Clicking "get email tickets now" is too slow. Any idea how to solve this.
Thanks
Offline
See documentation to create a cron task wich launch "cron.php" every minute, for example.
+
Dév. Fedora 29 - PHP 5.6/7.0/7.1/7.2/7.3/7.4 - MariaDB 10.3 - GLPI master
Certifié ITILv3 - RPM pour Fedora, RHEL et CentOS sur https://blog.remirepo.net/
Offline
I have installed GLPI 0.72.21 on Centos 5.3.
I have set up cron to start every minute and check for mail in
/etc/cron.d/glpi
*/1 * * * * apache /usr/bin/php /usr/share/glpi/front/cron.php.
if i check the cron log it shows
Oct 27 13:45:01 localhost crond[21969]: (apache) CMD (/usr/bin/php /usr/share/glpi/front/cron.php)
Oct 27 13:46:01 localhost crond[21974]: (apache) CMD (/usr/bin/php /usr/share/glpi/front/cron.php)
Oct 27 13:47:01 localhost crond[21979]: (apache) CMD (/usr/bin/php /usr/share/glpi/front/cron.php)
Everything looks fine, but mail is not recived. ("Get email tickets now" work's manually)
If I:
/usr/bin/php /usr/share/glpi/front/cron.php > output.log
log is empty
Need Help...
Offline
Check cron.log in /var/log/glpi (if installed from RPM, which seems to be the case)
+
Dév. Fedora 29 - PHP 5.6/7.0/7.1/7.2/7.3/7.4 - MariaDB 10.3 - GLPI master
Certifié ITILv3 - RPM pour Fedora, RHEL et CentOS sur https://blog.remirepo.net/
Offline
There is no cron.log, just php-errors.log wich is also empty.
The only other logs for glpi are:
/usr/share/glpi/files/_log/cron.log
/usr/share/glpi/files/_log/mail.log
/usr/share/glpi/files/_log/php-errors.log
/usr/share/glpi/files/_log/sql-errors.log
If I open /_log/cron.log
2009-10-27 08:10
Collect mails from {pop.googlemail.com:995/pop/ssl} for Root entity
2009-10-27 08:10
Number of messages available and collected : 1
2009-10-27 13:06
Update computer 4
2009-10-27 13:06
Update computer 57
2009-10-27 13:06
Update computer 8
2009-10-27 13:06
Update computer 30
2009-10-27 13:06
Update computer 32
2009-10-27 13:06
Update computer 55
2009-10-27 13:06
Update computer 11
2009-10-27 13:06
ocsng task was done (0.81s)
2009-10-27 13:43
Launch plugin_install
2009-10-27 13:43
plugin_install Nothing to do (0.02s)
2009-10-27 13:54
Launch dbreplicate
2009-10-27 13:54
dbreplicate Nothing to do (0.00s)
There is log for reciving mail, but that was this morning.. I have new mail waiting in inbox.
Last edited by vgracanin (2009-10-27 15:30:57)
Offline
Looking at your cron.log, it seems than system cron is not working.
Check file permission on files folder (and subtree).
If you have run the cron once under the root account, some file are probably locked.
+
Dév. Fedora 29 - PHP 5.6/7.0/7.1/7.2/7.3/7.4 - MariaDB 10.3 - GLPI master
Certifié ITILv3 - RPM pour Fedora, RHEL et CentOS sur https://blog.remirepo.net/
Offline
I have gave rights on /var/share/glpi/* to apache
drw-rw-r-- 2 apache apache 4096 Sep 7 09:21 ajax
-rw-rw-r-- 1 apache apache 63 Sep 7 09:21 CHANGELOG.txt
drw-rw-r-- 2 apache apache 4096 Oct 27 13:33 config
-rw-rw-r-- 1 apache apache 18004 Sep 7 09:21 COPYING.txt
drw-rw-r-- 2 apache apache 4096 Sep 7 09:21 css
drw-rw-r-- 16 apache apache 4096 Oct 26 13:17 files
drw-rw-r-- 2 apache apache 12288 Oct 27 14:40 front
drw-rw-r-- 2 apache apache 4096 Oct 27 13:03 inc
-rw-rw-r-- 1 apache apache 5345 Sep 7 09:21 index.php
drw-rw-r-- 3 apache apache 4096 Sep 7 09:21 install
drw-rw-r-- 11 apache apache 4096 Sep 7 09:21 lib
-rw-rw-r-- 1 apache apache 144 Sep 7 09:21 LISEZMOI.txt
drw-rw-r-- 2 apache apache 4096 Sep 7 09:21 locales
-rw-rw-r-- 1 apache apache 9033 Sep 7 09:21 login.php
-rw-rw-r-- 1 apache apache 2043 Sep 7 09:21 logout.php
drw-rw-r-- 4 apache apache 4096 Sep 7 09:21 pics
drw-rw-r-- 15 apache apache 4096 Oct 23 22:34 plugins
-rw-rw-r-- 1 apache apache 123 Sep 7 09:21 README.txt
-rw-rw-r-- 1 apache apache 9887 Sep 7 09:21 script.js
drw-rw-r-- 2 apache apache 4096 Sep 7 09:21 scripts
-rw-rw-r-- 1 apache apache 3707 Sep 7 09:21 status.php,
But I also tried running the cron directly from root account, with no luck either.
/usr/bin/php /usr/share/glpi/front/cron.php
Offline
Hi,
I still have no luck with the receivers.
Now I have installed ubuntu 9.10 server with glpi 0.72.3, imported my mysql databese and setup
crontab on the user account
*/1 * * * * /usr/bin/php /usr/share/glpi/front/cron.php &>/dev/null
I checked /var/log/syslog and cron starts every minute like it sholud.
Dec 3 20:54:01 GLPI CRON[16174]: (notroot) CMD (/usr/bin/php /usr/share/glpi/front/cron.php &>/dev/null)
Dec 3 20:54:10 GLPI crontab[16206]: (notroot) BEGIN EDIT (pingu)
Dec 3 20:55:01 GLPI CRON[16211]: (notroot) CMD (/usr/bin/php /usr/share/glpi/front/cron.php &>/dev/null)
Dec 3 20:56:01 GLPI CRON[16215]: (notroot) CMD (/usr/bin/php /usr/share/glpi/front/cron.php &>/dev/null)
Dec 3 20:56:36 GLPI crontab[16206]: (notroot) END EDIT (pingu)
Dec 3 20:57:01 GLPI CRON[16220]: (notroot) CMD (/usr/bin/php /usr/share/glpi/front/cron.php &>/dev/null)
Dec 3 20:58:01 GLPI CRON[16334]: (notroot) CMD (/usr/bin/php /usr/share/glpi/front/cron.php &>/dev/null)
Dec 3 20:59:01 GLPI CRON[16440]: (notroot) CMD (/usr/bin/php /usr/share/glpi/front/cron.php &>/dev/null)
Dec 3 21:00:01 GLPI CRON[16444]: (notroot) CMD (/usr/bin/php /usr/share/glpi/front/cron.php &>/dev/null)
Dec 3 21:01:01 GLPI CRON[16450]: (notroot) CMD (/usr/bin/php /usr/share/glpi/front/cron.php &>/dev/null)
The /usr/share/glpi/files/_log/cron.log show's that cron.php is not starting every minute, and if it does start the mailgate doesn't always...
dbreplicate Nothing to do (0.00s)
2009-12-03 20:37
Launch ocsng
2009-12-03 20:37
Check updates from server OCS Inventory server
2009-12-03 20:37
ocsng Nothing to do (0.00s)
2009-12-03 20:41
Launch dbreplicate
2009-12-03 20:41
dbreplicate Nothing to do (0.00s)
2009-12-03 20:42
Launch ocsng
2009-12-03 20:42
Check updates from server OCS Inventory server
2009-12-03 20:42
ocsng Nothing to do (0.00s)
2009-12-03 20:43
Launch mailgate
2009-12-03 20:43
Collect mails from {192.168.100.100/pop} for Root entity
2009-12-03 20:43
Number of messages available and collected : 0
2009-12-03 20:43
mailgate task was done (0.04s)
2009-12-03 20:46
Launch dbreplicate
2009-12-03 20:46
dbreplicate Nothing to do (0.00s)
2009-12-03 20:48
Launch ocsng
2009-12-03 20:48
Check updates from server OCS Inventory server
2009-12-03 20:48
ocsng Nothing to do (0.00s)
2009-12-03 20:54
Launch ocsng
2009-12-03 20:54
Check updates from server OCS Inventory server
2009-12-03 20:54
ocsng Nothing to do (0.00s)
2009-12-03 20:55
Launch mailgate
2009-12-03 20:55
Collect mails from {192.168.100.100/pop} for Root entity
2009-12-03 20:55
Number of messages available and collected : 0
2009-12-03 20:55
mailgate task was done (0.02s)
2009-12-03 20:57
Launch dbreplicate
2009-12-03 20:57
dbreplicate Nothing to do (0.00s)
Permissions are "drwxrwxrwx 14 notroot notroot 4096 2009-10-27 18:18 glpi" on the whole /usr/share/glpi and subtree
Is there any chance to set another php sript only to start the mailgate and collect mail?
I know I'm starting to get boring with this, and thanks remi for all the support, but I would really like to get glpi in the production environment for all the 1000+ users in the company.
Offline
I have this trouble to: more time before recive messages:
[root@vm05 ~]# grep -A 1 -i "Number of messages available and collected" /var/log/glpi/cron.log
Number of messages available and collected : 0
2010-05-12 13:41
--
Number of messages available and collected : 1
2010-05-12 14:11
--
Number of messages available and collected : 3
2010-05-12 14:22
[root@vm05 ~]#
But cron job running every minutes:
[root@vm05 ~]# cat /etc/cron.d/glpi
# GLPI core
# Run cron from to execute task even when no user connected
*/1 * * * * apache /usr/bin/php /usr/share/glpi/front/cron.php
[root@vm05 ~]#
[root@vm05 ~]# tail /var/log/glpi/cron.log
2010-05-12 14:23
Launch dbreplicate
2010-05-12 14:23
dbreplicate Nothing to do (0.00s)
2010-05-12 14:24
Launch ocsng
2010-05-12 14:24
Check updates from server localhost
2010-05-12 14:24
ocsng Nothing to do (0.00s)
[root@vm05 ~]#
and, i wait more time to sync new mails....
[root@vm05 ~]# rpm -qa | grep glpi
glpi-mass-ocs-import-1.3.0-1.el5
glpi-data-injection-1.7.0-1.el5
glpi-0.72.4-2.svn11035
[root@vm05 ~]#
Last edited by sHaggY_caT (2010-05-12 12:30:07)
Offline
I had the same problem here with the cron job.
when i debug I see that the query to pull cron jobs is looking for
{...query...} AND `mode`='2' {...query...}
which none of my tasks have mode set to 2...
this value is set in cron.php when the job is executed
CronTask::launch(CronTask::MODE_EXTERNAL, $CFG_GLPI['cron_limit']);
Im on .78 RC1, it looks like you need to set the schedule tasks "Run Mode" to "CLI"
When I updated the tasks "Run Mode" everything worked perfectly.
-paul
FULL Cron query :
SELECT *, LOCATE('Plugin',itemtype) as ISPLUGIN
FROM `glpi_crontasks`
WHERE (`itemtype` NOT LIKE 'Plugin%' OR `itemtype` LIKE 'Pluginwebdavcollector%') AND `state`='1' AND `mode`='2' AND ((`hourmin` < `hourmax` AND '08' >= `hourmin` AND '08' < `hourmax`)
OR (`hourmin` > `hourmax`
AND ('08' >= `hourmin` OR '08' < `hourmax`)))
AND (`lastrun` IS NULL
OR unix_timestamp(`lastrun`) + `frequency` < unix_timestamp(now()))
ORDER BY ISPLUGIN, unix_timestamp(`lastrun`)+`frequency`
Offline
@punkdali you post have no link with the subject as your are using 0.78RC
> Im on .78 RC1, it looks like you need to set the schedule tasks "Run Mode" to "CLI"
> When I updated the tasks "Run Mode" everything worked perfectly.
This is the expected behavoiur
+
Dév. Fedora 29 - PHP 5.6/7.0/7.1/7.2/7.3/7.4 - MariaDB 10.3 - GLPI master
Certifié ITILv3 - RPM pour Fedora, RHEL et CentOS sur https://blog.remirepo.net/
Offline
Pages: 1