Hi,
I'm encountering a strange problem in nectar. I set up a report with 2 different items. When I preview the report everything looks good. In the log file I can see the correct graphs as well (debug level). When the email is sent, in the body of the email the first graph is repeated, no matter what other items I chose. When I click on the graph it links to the correct one.
I hope this picture explains it better:
If I set it to attach the graphs, they are correct.
I'm running PIA3.1, nectar 0.35a, cacti 0.8.8b. Windows install, using exchange as mail server (smtp)
Appreciate any help.
Nectar showing wrong graph in email preview
Moderators: Developers, Moderators
Re: Nectar showing wrong graph in email preview
Hi Avantat,
I have the same problem, did you find a solution?
Thanks~
I have the same problem, did you find a solution?
Thanks~
Re: Nectar showing wrong graph in email preview
Unfortunately not. I works if I attach the pictures to the email vs inline, but I would like it better inline.
Re: Nectar showing wrong graph in email preview
We had the same problem, seems to only affect Windows. The problem is in the <cacti_dir>plugins\settings\include\mailer.php file.avantat wrote:Hi,
I'm encountering a strange problem in nectar. I set up a report with 2 different items. When I preview the report everything looks good. In the log file I can see the correct graphs as well (debug level). When the email is sent, in the body of the email the first graph is repeated, no matter what other items I chose. When I click on the graph it links to the correct one.
If I set it to attach the graphs, they are correct.
I'm running PIA3.1, nectar 0.35a, cacti 0.8.8b. Windows install, using exchange as mail server (smtp)
Appreciate any help.
There is a function called content_id() which (on Windows) will return the same ID number as the previous invocation if it is called again too quickly. I didn't measure how quickly but unless separated by some hundredths of seconds it will return the same ID. The problem relates to how the PHP function microtime() operates on Windows. The ID numbers returned by that function are used by the mailer to tag the inline content so if they are the same, you will see the same graph repeated.
Around line 463 find the function:
Code: Select all
function content_id() {
list($usec, $sec) = explode(" ", microtime());
$usec = $usec * 10000000;
return getmypid() . "_" . $sec . "_" . $usec . "@" . $this->Config["Hostname"];
}
Code: Select all
function content_id() {
list($usec, $sec) = explode(" ", microtime());
$usec = $usec * 10000000;
$randVal = mt_rand(1000, 900000);
return getmypid() . "_" . $sec . "_" . $usec . "_" . $randVal . "@" . $this->Config["Hostname"];
}
Re: Nectar showing wrong graph in email preview
Thanks dvc, that solved the issue for us as well.
Who is online
Users browsing this forum: No registered users and 0 guests