Zabbix logo

ASP.NET web application monitoring in Zabbix, part 2

When you host multiple websites in IIS, and you need to monitor them, Zabbix is one of your options. In Zabbix, you can take advantage of Windows Servers performance counters using perf_counter and perf_counter_en. In this article, I’ll show you some important Windows performance counters to monitor your ASP.NET web application in Zabbix.

The difference between perf_counter and perf_counter_en is: the first returns a value of any Windows performance counter, and the second does the same, but in English. Learn more about Windows-specific item keys in Zabbix’ documentation. I’ll be using perf_counter_en.

Performance counters for .NET, ASP.NET, Exceptions and performance

Some important performance counters for the overall performance status of your web server and ASP.NET web application are, in random order:

  • .NET CLR Exceptions(*)\# of Exceps Thrown
  • .NET CLR Memory(*)\% Time in GC
  • .NET CLR Memory(*)\Gen 0 heap size
  • .NET CLR Memory(*)\Gen 1 heap size
  • .NET CLR Memory(*)\Gen 2 heap size
  • ASP.NET\Application Restarts
  • ASP.NET\Applications Running
  • ASP.NET\Request Execution Time
  • ASP.NET\Worker Process Restarts
  • ASP.NET Applications(*)\Errors Total
  • ASP.NET Applications(*)\Requests/Sec

Use PowerShell‘s Get-Counter cmdlet to try them out.

Add Windows Performance Counters to your Zabbix IIS template

It is not that hard to add these performance counters to your Zabbix template. For example a normal item:

		<name>Global .NET</name>
<!-- ... -->
	<name>.NET CLR Exceptions</name>
	<key>perf_counter_en["\.NET CLR Exceptions(*)\# of Exceps Thrown"]</key>
	<description>Displays the total number of exceptions thrown since the application started. This includes both .NET exceptions and unmanaged exceptions that are converted into .NET exceptions. For example, an HRESULT returned from unmanaged code is converted to an exception in managed code.</description>
			<name>Global .NET</name>
Code language: HTML, XML (xml)

Other items can take an application pool name, you can add that in an appropriate discovery_rule item_prototype. For example APP_POOL_WAS(*)\Current Application Pool State, which returns the current state of your application pool:

	<name>IIS: AppPool {#APPPOOL} state</name>
	<key>perf_counter_en["\APP_POOL_WAS({#APPPOOL})\Current Application Pool State"]</key>
	<description>The state of the application pool.</description>
		<name>Application pool state</name>
			<expression>{last()}&lt;&gt;3 and {$IIS.APPPOOL.MONITORED:"{#APPPOOL}"}=1</expression>
			<name>IIS: Application pool {#APPPOOL} is not in Running state</name>
<!- ... -->
Code language: HTML, XML (xml)

Be sure to set a correct value_map:

	<name>Application pool state</name>
			<newvalue>Shutdown Pending</newvalue>
			<newvalue>Delete Pending</newvalue>
Code language: HTML, XML (xml)

Are you looking for rock solid, eco-friendly, .NET hosting? Look no further! UmbHost offers powerful hosting services for websites and businesses of all sizes, and is powered by 100% renewable energy!

Jan Reilink

Hi, my name is Jan. I am not a hacker, coder, developer or guru. I am merely an application manager / systems administrator, doing my daily thing at Embrace - The Human Cloud. In the past I worked for clidn and Vevida. With over 20 years of experience, my specialties include Windows Server, IIS, Linux (CentOS, Debian), security, PHP, websites & optimization. I blog at

1 Comment
Oldest Most Voted
Inline Feedbacks
View all comments
20/12/2022 16:21

[…] wrote about Zabbix monitoring before, for example how you can monitor the performance of IIS application pools in Zabbix. In this post I’ll address five types of monitoring for SQL Server for […]