Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoke-IcingaCheckMemory Pagefile Percent Warning and Critical Threshold still not working #379

Open
audiocoach opened this issue Jan 10, 2024 · 5 comments

Comments

@audiocoach
Copy link

According to #367 and #363 this was fixed in 1.11.1 but it is still not working

image

image

Icinga 2.14.1
Icinga Web 2.12.1
Icinga Director 1.11
Icinga for Windows 1.11.1

@log1-c
Copy link

log1-c commented Jan 19, 2024

Hm, can't confirm.
image
image

fresh installation of framework & plugins v1.11.1 and icinga agent v2.14.0

@audiocoach
Copy link
Author

Ok, I think I have found the problem. It has to do with the pagefile settings. If you set the pagefile to system managed for all disks it works as expected. But if you set the pagefile for each drive manually the threshold percentage is calculated wrong. In my case I have the pagefile on a separate drive because for hyper-v replication it is recommended to put the pagefile on a separate drive which is excluded from the replication.

image

@log1-c
Copy link

log1-c commented Jan 22, 2024

Have you tried specifically including the pagefile via parameter? Maybe that helps.

@audiocoach
Copy link
Author

Yes. Unfortunatley the problem persists.

@audiocoach
Copy link
Author

audiocoach commented Mar 19, 2024

``I think, I found a solution. The problem is that when you disable the "manage pagefile for all disks automatically" in the windows settings gui the pagefile is considered manual managed even if you set that the size should be automatically managed like in my screenshot above. My solution looks as follows:

Replace lines 60 -71 in the Get-IcingaMemoryPerformanceCounter.psm1 (located at C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-plugins\provider\memory)

Original Code:

            $MemoryData.PageFile.Add(
                $entry.Name,
                @{
                    'InitialSize' = $entry.InitialSize * 1024 * 1024;
                    'Managed'     = $TRUE;
                    'Name'        = $entry.Name;
                    'TotalSize'   = $entry.MaximumSize * 1024 * 1024;
                }
            );

           $MemoryData['PageFile Total Bytes'] += $entry.MaximumSize * 1024 * 1024;
           $MemoryData['PageFile Used Bytes']  += $entry.InitialSize * 1024 * 1024;

Solution Code:

            if ($entry.MaximumSize -ne 0) {
            $MemoryData.PageFile.Add(
                $entry.Name,
                @{
                    'InitialSize' = $entry.InitialSize * 1024 * 1024;
                    'Managed'     = $TRUE;
                    'Name'        = $entry.Name;
                    'TotalSize'   = $entry.MaximumSize * 1024 * 1024;
                }
            );

           $MemoryData['PageFile Total Bytes'] += $entry.MaximumSize * 1024 * 1024;
           $MemoryData['PageFile Used Bytes']  += $entry.InitialSize * 1024 * 1024;
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants