phaag / nfsen

Legacy NfSen code
Other
21 stars 9 forks source link

Adding a sflow source to a continuous/shadow profile breaks NfSen when opening Details tab for this profile #9

Closed atbohmer closed 1 year ago

atbohmer commented 1 year ago

nfdump 1.7 sflow source works well with the standard live profile in NfSen, but when adding this source to a new continuous/shadow profile it breaks the profile. When opening the Details tab, ik cuts showing the page at this flow source.

Tue Mar 07 11:13:22.177934 2023] [php:error] [pid 25402] [client x.x.x.x:51020] PHP Fatal error: Uncaught TypeError: Unsupported operand types: string / int in /var/www/html/nfsen/nfsenutil.php:312\nStack trace:\n#0 /var/www/html/nfsen/details.php(1152): ScaleValue()\n#1 /var/www/html/nfsen/nfsen.php(778): DisplayDetails()\n#2 {main}\n thrown in /var/www/html/nfsen/nfsenutil.php on line 312, referer: https://server/nfsen/nfsen.php?bookmark=MHwwfC4vREN8ZGMywxNjc4MDk0MTAwfDE2NzgwOTQxMDB8MHwxfDA%3D

[Tue Mar 07 11:13:22.178193 2023] [php:error] [pid 25402] [client x.x.x.x:51020] PHP Fatal error: Uncaught Exception: Serialization of 'Socket' is not allowed in [no active file]:0\nStack trace:\n#0 {main}\n thrown in [no active file] on line 0, referer: https://server/nfsen/nfsen.php?bookmark=MHwwfC4vRENNDEwMHwxNjc4MDk0MTAwfDE2NzgwOTQxMDB8MHwxfDA%3D

phaag commented 1 year ago

The new php versions seem to be more strict on operand types. This can be fixed, but I am afraid, there are potentially other locations in the code as well.

atbohmer commented 1 year ago

Great, like you probably noticed I have no php programming experience, but I know how to code so maybe I can help to improve nfsen a little bit? Is it doable for a php noob to search for operand types and correct them, or is it more for the greater coding gods?