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

CPU usage not working (Win/IIS) #214

Open
kbostick88 opened this issue Dec 13, 2019 · 12 comments
Open

CPU usage not working (Win/IIS) #214

kbostick88 opened this issue Dec 13, 2019 · 12 comments

Comments

@kbostick88
Copy link

Your environment:

  • Operating system: Windows Server 2019 build 1809

  • Webserver: IIS

  • PHP Version: 7.3.7

  • Monitorr Version: 1.7.6m

Describe your issue:

I have read the t-shooting Wiki at: https://github.com/Monitorr/Monitorr/wiki/06-Troubleshooting

I installed Monitorr for the second time on a new SSD, when I installed it, my CPU usage is not being updated. RAM, HD and Uptime are all working correctly. but CPU is at 0%

@seanvree
Copy link
Member

@kbostick88 are there any relevant entries in the PHP logs?

Also, do you by chance have GIT installed?

https://github.com/Monitorr/Monitorr/wiki/01-Config:--Initial-configuration#prerequisites

@seanvree seanvree self-assigned this Dec 16, 2019
@kbostick88
Copy link
Author

@seanvree I have all the PHP dependancies installed, I did also install GIT, the command for Uptime comes back with my uptime as expected.

It appears this is an issue with Monitorr working with IIS, I installed Monitorr using IIS on 3 different servers, same result on all of them. I installed WAMPS on 2 of them, and both CPU stats immediately started working.

@seanvree
Copy link
Member

seanvree commented Dec 21, 2019

@kbostick88 you might be right.

I've been running some tests w/ IIS on Win10 and I can't get the CPU usage to work either. Last time I KNOW it worked on IIS was ~Feb 19 (I normally run IIS as I'm an MS guy). I hadn't been running Monitorr lately as I've been busy with my day job and must have missed a change/update somewhere.

I rolled back PHP to a version that I KNOW worked, but that is not returning values, so it might be GIT or a security feature in IIS/Windows.

Just to be clear you CAN run both of these commands from a normal CMD prompt, right?

wmic cpu get loadpercentage /all

cut -d. -f1 /proc/uptime

image

I'll keep you updated.

@seanvree
Copy link
Member

seanvree commented Dec 21, 2019

@kbostick88

Okay, figured this out...partially.

It looks like there was an update to the default security settings/perms for IIS and/or PHP

To get around this you need to change the perms of the IIS DefaultAppPool Identity to "LocalService" or "LocalSystem". I recommend "LocalService" for the time being. Make sure you read up on the security implications of this.

Change the following value:
IIS Mgr -> Application Pools -> DefaultAppPool -> Advanced Settings -> Identity -> Built-In Account

Make sure to restart IIS after changing that value.

image

@seanvree seanvree added WiKi and removed bug labels Dec 21, 2019
@seanvree seanvree pinned this issue Dec 21, 2019
@kbostick88
Copy link
Author

kbostick88 commented Dec 21, 2019 via email

@seanvree seanvree changed the title CPU usage not working CPU usage not working (Win/IIS) Dec 23, 2019
@kbostick88
Copy link
Author

I have set up Monitorr on IIS again instead of WAMPS and the issue is still there. running the GIT command pulls the CPU % but in the app, it is not updating - just sits at 0% I have a buddy that installed Monitorr on his Server 19 build with IIS - same issue

@seanvree
Copy link
Member

seanvree commented Feb 6, 2020

@kbostick88 can you copy the contents of the applicationHost.config file to a GIST and post the link?

%WINDIR%\system32\inetsrv\config\applicationHost.config

Also, a screenshot of IIS mgr like I posted above would help.

Thanks,

@seanvree
Copy link
Member

seanvree commented Feb 6, 2020

@kbostick88 I deleted your previous reply - you need to delete that GIST asap. It has some raw passwords in it.

Also, I'm not sure how savvy you are with IIS, but on line 142-147 you have two diff appPools listed - which one is Monitorr running on?

Also, I don't see a screenshot anywhere?

@Monitorr Monitorr deleted a comment from kbostick88 Feb 6, 2020
@kbostick88
Copy link
Author

kbostick88 commented Feb 6, 2020 via email

@seanvree
Copy link
Member

seanvree commented Feb 6, 2020

@kbostick88

So, like I said, a screenshot of the bozflix AppPool properties would help.

Also, I'm not sure if this would make a diff, but this is what my appPool's config is:

    <add name="DefaultAppPool" autoStart="true" managedRuntimeVersion="v4.0" startMode="OnDemand">
        <processModel identityType="LocalService" />
    </add>

Mine is working, so I would suggest trying to replicate those settings (besides the name) into your applicationHost.config file to see if that works. Make sure you make a backup and restart IIS anytime you make changes to the file and/or appPool properties.

Also, can you browse to assets/php/phpinfo.php in your Monitorr directory at and post a screenshot of the top part?

image

@kbostick88
Copy link
Author

kbostick88 commented Feb 6, 2020 via email

@seanvree
Copy link
Member

seanvree commented Feb 6, 2020

@kbostick88 are you on discord by chance? Here's the Monitorr server: https://discord.gg/YKbRXtt

When you get in there, shoot me a message.

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

No branches or pull requests

2 participants