Hi,

I have created a custom sensor that retreives some values via powershell and hand them to PRTG afterwards. The sensor appeared to work just fine until this morning when it had to give an error, which it did not. The value my script returned i way above the error level, but my sensor does not go down. It does not even give me a warning. The added XML is the XML node that is supposed to give me a down status.

    <result>
        <channel>_BIProcessorQueue</channel>
        <unit>Custom</unit>
        <CustomUnit>#</CustomUnit>
        <mode>Absolute</mode>
        <showChart>1</showChart>
        <showTable>1</showTable>
        <float>0</float>
        <value>44664</value>
        <LimitMaxError>499</LimitMaxError>
        <LimitMaxWarning>200</LimitMaxWarning>
        <LimitWarningMsg>This queue has over 200 messages.</LimitWarningMsg>
        <LimitErrorMsg>This queue has over 500 messages.</LimitErrorMsg>
    </result>

Article Comments

From what I see your XML seems to be okay - but I admit I had to add <PRTG> tags and remove quite some spaces from what you posted.. but I don't think that necessarily is the issue.

<PRTG>
	<result>
		<channel>_BIProcessorQueue</channel>
		<unit>Custom</unit>
		<CustomUnit>#</CustomUnit>
		<mode>Absolute</mode>
		<showChart>1</showChart>
		<showTable>1</showTable>
		<float>0</float>
		<value>44664</value>
		<LimitMaxError>499</LimitMaxError>
		<LimitMaxWarning>200</LimitMaxWarning>
		<LimitWarningMsg>This queue has over 200 messages.</LimitWarningMsg>
		<LimitErrorMsg>This queue has over 500 messages.</LimitErrorMsg>
	</result>
</PRTG>

What I am missing is this tag:

<LimitMode>1</LimitMode>

You did a great job mentioning all those settings in the output - but this one is missing - and cause it is 0 by default, your limits aren't active and therefor the sensor will not raise an error.

Details can be found here: https://www.paessler.com/manuals/prtg/custom_sensors

Test it out while forcing the script to return higher counts and you will see once you set the LIMITMODE it fill cause alerts in PRTG.

If it doesn't help, please reply!

Regards

Florian Rossmark

www.it-admins.com


Nov, 2018 - Permalink