Welcome to OCS Inventory NG community support, where you can ask questions and receive answers from other members of the community.

Please ask questions only in English or French.

Release 2.11.1 available

The official documentation can be found on http://wiki.ocsinventory-ng.org. Read it before asking your question.

notification does not work!

I have installed the oc inventory server 2.5, and notification does not work. I made the same setup as here http://ask.ocsinventory-ng.org/9931/how-to-use-the-new-notification-feature?show=9931#q9931 

 but it does not work!

looking at the log files, no error is shown!

in OCS Inventory NG server for Unix by (370 points)

11 Answers

+1 vote

Hi @adriano,

this feature works on my config, several feasible errors :

- phpmailer dependency not installed

- crontab not or badly defined (bad syntax, bad user [for e.g. not apache])

- Time not expired in OCSReports / Configuration / Notifications / NOTIF_PROG_TIME (for this first release of notification, only one time per day)

- Erroneous or too complex email settings (authentication or SSL required, etc.)

- Categories not defined in OCSReports / Manage / Software and Assets categories

Normally, the cron_mailer.php file is executed every minute, checks the time set in OCSreports:

- If the time is not reached, the notification function is canceled
- if the time is right, the notification function is executed and an email is send with categories informations

What do you read in '/tmp/phpmailer-errors.log' ? Does this file exist ? (cf. http://ask.ocsinventory-ng.org/9931/how-to-use-the-new-notification-feature?show=9931#q9931)


What distribution / version of Linux do you use ?

Regards, Stéphane

by (32.6k points)
0 votes

What do you read in '/tmp/phpmailer-errors.log' ?

When I restore a machine, the log file was no longer created


What distribution / version of Linux do you use ?

Debian 9 Stretch

by (370 points)
edited by
0 votes

By default in OCS, the file '/tmp/phpmailer-errors.log' does not exist …

> This is a tip that I proposed in my other post only for help and debugging purposes

This file must be in the OCS server (not on client machine) and created / updated every time cron_mailer.php is normally run

> Sorry, I do not understand the relationship with the restoration of one of your machines and this file…

Ok for Debian 9

Note: I just made a modification of my answer from the other post (error in the tree and add infos)

by (32.6k points)
0 votes

This file must be in the OCS server (not on client machine) and created / updated every time cron_mailer.php is normally run


the cron_mailer.php file is normally running in crontab. however when I rebooted the host, the log file is not created anymore.

by (370 points)
0 votes

ok, I understand better, it's true : The folder /tmp is also emptied on my Debian each reboot

You can choose another destination, which will not be flushed, for example: /var/tmp

by (32.6k points)
0 votes

phpmailer-errors.log

[12-Nov-2018 16:22:05 America/Sao_Paulo] PHP Warning:  require(/usr/share/ocsinventory-reports/ocsreports/libraries/PHPMailer-6.0.5/src/usr/share/ocsinventory-reports/ocsreports/libraries/PHPMailer-6.0.5/src/Exception.php): failed to open stream: No such file or directory in /usr/share/ocsinventory-reports/ocsreports/require/mail/NotificationMail.php on line 31

[12-Nov-2018 16:22:05 America/Sao_Paulo] PHP Fatal error:  require(): Failed opening required '/usr/share/ocsinventory-reports/ocsreports/libraries/PHPMailer-6.0.5/src/usr/share/ocsinventory-reports/ocsreports/libraries/PHPMailer-6.0.5/src/Exception.php' (include_path='.:/usr/share/php') in /usr/share/ocsinventory-reports/ocsreports/require/mail/NotificationMail.php on line 31

by (370 points)
edited by
0 votes

Okay ! With my tip, we can have details on the problem and investigate !

Missing libraries in : /usr/share/ocsinventory-reports/ocsreports/libraries/PHPMailer-6.0.5/src/

In this folder, you should have these files :

 - Exception.php

 - OAuth.php

 - PHPMailer.php

 - POP3.php

 - SMTP.php

by (32.6k points)
0 votes


looked folder, and the files you are quoted are there!ocs

by (370 points)
0 votes
help Please!!!!

 PHP Fatal error:  require_once(): Failed opening required '../dbconfig.inc.php' (include_path='.:/usr/share/php') in /usr/share/ocsinventory-reports/ocsreports/tools/cron_mailer.php on line 11
by (370 points)
0 votes

Hi,

in /usr/share/ocsinventory-reports/ocsreports/tools/cron_mailer.php

for the six 'require_once' lines, you can change to :

require_once('/usr/share/ocsinventory-reports/ocsreports/dbconfig.inc.php');
require_once('/usr/share/ocsinventory-reports/ocsreports/var.php');
require_once('/usr/share/ocsinventory-reports/ocsreports/require/function_commun.php');
require_once('/usr/share/ocsinventory-reports/ocsreports/require/mail/NotificationMail.php');
require_once('/usr/share/ocsinventory-reports/ocsreports/require/config/include.php');
require_once('/usr/share/ocsinventory-reports/ocsreports/require/fichierConf.class.php');

by (32.6k points)
 
Powered by Question2Answer
...