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.

How to use the new Notification feature?

Hi,

i wanted to ask how to use this feature.

i first tried the following settings:

NOTIF_FOLLOW: ON

NOTIF_MAIL_ADMIN: something @ gmail.com

NOTIF_NAME_ADMIN: ali99

NOTIF_NAME_REPLY: SMTP+SSL

NOTIF_SMTP_HOST: smtp.gmail.com

NOTIF_PORT_SMTP: 465

NOTIF_PROG_TIME: 02:35 PM

NOTIF_PROG_DAY: All Days

It didn't send me any mail. Then i tried to tinker with the HOST and SNMP Option, didn't work either.

After that i added my Mail/ Password in the Optional columns here:

NOTIF_USER_SMTP/NOTIF_PASSWD_SMTP.

Still didn't get any mail.

So how do i configure it.
And what i don't understand is, how will it send me an mail, when there is no required option
to give it an mail address it can use to send the mails?

Looking forward to your help.
in Administrative console by (300 points)
edited by

2 Answers

+1 vote
 
Best answer

Hi @ali99,

the email notification feature works on OCS v. 2.5, even if it is not yet mature and not very detailed in OCS wiki, you must (in my case Debian jessie) :

Install php-mailer :

apt-get install libphp-phpmailer

Create a scheduled task with the apache user:

crontab -u www-data -e


Add the line at the end of file :

*/1 * * * * php /usr/share/ocsinventory-reports/ocsreports/tools/cron_mailer.php

In OCSreports, go to Configuration > Notifications and set time (NOTIF_PROG_TIME) for a run in next few minutes.

To debug (if necessary) :

Add the following lines (after <?php and before require_once…) of the /usr/share/ocsinventory-reports/ocsreports/tools/cron_mailer.php file:

// log phpmailer errors
@ini_set ('log_errors', 'On');
@ini_set ('display_errors', 'Off');
@ini_set ('error_log', '/tmp/phpmailer-errors.log'); // path to server-writable log file

For details of cron_mailer.php execution status, read the /tmp/phpmailer-errors.log file, e. g. :

[26-Oct-2018 11:00:01 Europe/Berlin] Message could not be sent. Mailer Error:
[27-Oct-2018 11:00:01 Europe/Berlin] Message has been sent
[28-Oct-2018 11:00:01 Europe/Berlin] Message has been sent

Regards, Stéphane

Edit of 2018/11/09: Wrong entry in the tree in blue (folder "tools" only in lower case)

by (32.6k points)
selected by
0 votes
Can anyone confirm that this feature works, because on Roadmap it says "Testing"?
by (300 points)
 
Powered by Question2Answer
...