Page 1 of 1

NCPA Wizard Memory Usage is incorrect

Posted: Wed Jun 24, 2020 10:53 pm
by GldRush98
The wizard doesn't seem to display the currently used values for memory correctly. I've noticed this for both a test windows system and a test linux system.
During a the config wizard, this is displayed:
Capture.PNG
But this is what that machine is currently using:
Capture2.PNG
Capture3.PNG
Not sure what numbers are being shown in the wizard, but it's not the current memory usage.

Re: NCPA Wizard Memory Usage is incorrect

Posted: Thu Jun 25, 2020 3:30 pm
by cdienger
Thanks for bringing that to our attention. I will file a bug for this but in the meantime you can fix it by editing lines 721 and 753 in /usr/local/nagiosxi/html/includes/configwizards/ncpa/ncpa.inc.php from looking like this:

Code: Select all

<input type="text" style="width: 50px; height: 26px;" value="' . $mem_data['used'][0] . '" class="form-control condensed">
and

Code: Select all

<input type="text" style="width: 50px; height: 26px;" value="' . $swap_data['used'][0] . '" class="form-control condensed">
to using percent:

Code: Select all

<input type="text" style="width: 50px; height: 26px;" value="' . $mem_data['percent'][0] . '" class="form-control condensed">
and

Code: Select all

<input type="text" style="width: 50px; height: 26px;" value="' . $swap_data['percent'][0] . '" class="form-control condensed">

Re: NCPA Wizard Memory Usage is incorrect

Posted: Thu Jun 25, 2020 4:46 pm
by GldRush98
I think you copied and pasted the same wrong lines ;)
And forgot to mention which file ;)

Fortunately it was enough to get me there.
Edit:
/usr/local/nagiosxi/html/includes/configwizards/ncpa/ncpa.inc.php
And change those lines to:

Code: Select all

<input type="text" style="width: 50px; height: 26px;" value="' . $mem_data['percent'][0] . '" class="form-control condensed">
and

Code: Select all

<input type="text" style="width: 50px; height: 26px;" value="' . $swap_data['percent'][0] . '" class="form-control condensed">
Now it looks right! :geek:

Re: NCPA Wizard Memory Usage is incorrect

Posted: Thu Jun 25, 2020 4:53 pm
by cdienger
Sure did! Corrected now. Must be low on caffeine... Glad you were able to sort it out!