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.5 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!

asked ago in OCS Inventory NG server for Unix by (290 points)

8 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

answered ago by (24.9k 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

answered ago by (290 points)
edited ago 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)

answered ago by (24.9k 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.

answered ago by (290 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

answered ago by (24.9k 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

answered ago by (290 points)
edited ago 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

answered ago by (24.9k points)
0 votes


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

answered ago by (290 points)
 
Powered by Question2Answer
...