nethesis / dev

Nethesis issue tracker
http://www.nethesis.it
4 stars 1 forks source link

weekly report: flashstart section not working #5560

Closed cotosso closed 5 years ago

cotosso commented 5 years ago

NethServer with cloud content filter working and enabled also in weekly reports. Weekly reports doesn't show flashstart section anymore.

Steps to reproduce

Expected behavior

Next weekly report will show correctly every section including cloud content filter

Actual behavior

Components version: NethServer release 7.6.1810 (final) package: nethserver-flashstart-2.1.0-1.ns7.noarch


When we execute the script that creates the weekly report we receive this error:

root@S60EX ~]# /sbin/e-smith/weekly-report
PHP Fatal error:  SOAP-ERROR: Encoding: object has no 'ProfilePort' property in /usr/libexec/nethserver/nethserver-flashstart-report on line 104
malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "FlashStartWS error: ...") at /usr/share/nethserver-report/miners/FlashStart line 37.

If we execute the script /usr/libexec/nethserver/nethserver-flashstart-report that is called by /sbin/e-smith/weekly-report we receive the same error:

[root@S60EX ~]# /usr/libexec/nethserver/nethserver-flashstart-report
PHP Fatal error:  SOAP-ERROR: Encoding: object has no 'ProfilePort' property in /usr/libexec/nethserver/nethserver-flashstart-report on line 104
FlashStartWS error: SOAP-ERROR: Encoding: object has no 'ProfilePort' property

Talking with Flashstart support we found that the value PortNumber is not used anymore, instead they are actually using this variable ProfilePort.

Just changing the variable's name seems enough to fix the problem:

\# diff -u /usr/libexec/nethserver/nethserver-flashstart-report.ori /usr/libexec/nethserver/nethserver-flashstart-report
--- /usr/libexec/nethserver/nethserver-flashstart-report.ori    2019-01-17 14:27:51.360518933 +0100
+++ /usr/libexec/nethserver/nethserver-flashstart-report        2019-01-17 14:27:58.990971854 +0100
@@ -95,7 +95,7 
                 $array_report_param["CustomerEmail"]=$customer_email;
                 $array_report_param["DateFrom"]=$date_from;
                 $array_report_param["DateTo"]=$date_to;
\-                $array_report_param["PortNumber"]=0;
\+                $array_report_param["ProfilePort"]=0;
                 $array_report_param["TimeFrom"]="00:00:00";
                 $array_report_param["TimeTo"]="00:00:00";
                 $array_report_param["ViewDetails"]=0;

After that the scripts returns a good result:

\#  /usr/libexec/nethserver/nethserver-flashstart-report
{"RCATBLOCCATI_CLOUD_MV":{"title":"Bloccati per categoria","url":"https:\/\/cloud.flashstart.com\/www\/inc\/_chart.istogramma.php?rnd=995673&typeFS=4&maxWi=958&maxHe=200&barWi=60&barStyle=orange&hideLblX=0&fontSize=&fontColor=&breakLabel=0&limitChar=16&SetDistAxisY=&arrayVal=Cracks+e+warez%7C2415%3BNotizie%7C2264%3BMalware+Community%7C341%3BCDN+-+Server+contenuti%7C262%3BGioco+d%27azzardo%7C139%3BAziende%7C122%3BProxy+anonimi%7C83%3BFilesharing%7C70%3BPornografia%7C27%3BPubblicita%27%7C25","icon":""},"RMALWARERES_CLOUD_MV":{"title":"Malware: host infetti bloccati","url":"https:\/\/cloud.flashstart.com\/www\/inc\/_chart.istogramma.php?rnd=674544&typeFS=4&maxWi=958&maxHe=200&barWi=60&barStyle=black&hideLblX=0&fontSize=&fontColor=&breakLabel=0&limitChar=16&SetDistAxisY=&arrayVal=Malware+Community%7C341%3B%7C%3B%7C%3B%7C%3B%7C%3B%7C%3B%7C%3B%7C%3B%7C%3B%7C","icon":"https:\/\/cloud.flashstart.com\/www\/img\/ico-report_RMALWARERES_CLOUD_MV.png"}}
nethbot commented 5 years ago

in 7.6.1810/nethesis-testing:

gsanchietti commented 5 years ago

Test case

nethbot commented 5 years ago

in 7.6.1810/nethesis-testing:

cotosso commented 5 years ago

Everything worked as expected.

nethbot commented 5 years ago

in 7.6.1810/nethesis-updates: