Hi,

i'm trying to create a custom powershell scripts to integrate with MS teams, and i am running into a problem where in i want to find out the following details

 [string]$sensor= 'Windows CPU Load',
    [int]$sensorid= '5518',
    [string]$status='prtg_status',
    [string]$message='prtg_message',
    [string]$device='test',
    [string]$since='prtg_since',
    [string]$lastup='prtg_lastup',
    [string]$sensorURL='prtg_sensorurl',
    [string]$deviceURL='prtg_deviceurl',
    [string]$serviceURL='service_url'

i want to monitor for example any service , in this case, the windows cpu load on the server "test".

i am not sure what to enter in the $message, $since and rest of the above code. where can i find the details?


Article Comments

Hello there,

Thanks for your inquiry, we appreciate your contact regarding this matter!

Since a few versions MS Teams is integrated in our notifications. Please open the settings of a notification and scroll down to "Send Microsoft Teams Message". You can configure the notification there.

Please do not hesitate to ask further questions.


Kind regards,
Birk Guttmann, Tech Support Team


Jul, 2018 - Permalink

Hi, i have added the notification and it is sending data to a teams channel but it is not displaying any parameters, just the name of the sensor and the device is correctly displayed, and rest like sensor status, since, device/service url do not show any data.

how do i correctly feed the data for those parameters?


Jul, 2018 - Permalink

Hi,

Please let us know which placeholders you are using here.


Kind regards,
Birk Guttmann, Tech Support Team


Jul, 2018 - Permalink

Hi,

can you give me any examples of the placeholders that i should be using?


Jul, 2018 - Permalink

Please see What placeholders can I use with PRTG? :)


Kind regards,
Stephan Linke, Tech Support Team


Aug, 2018 - Permalink

well i used the following placeholders but i am not getting a correct notification on MS teams.

Windows CPU Load on DC01 is in a %status state! Details Current State %status Message %message Since %since Last up %lastup Sensor prtg_sensorurl Device prtg_deviceurl Management URL %serviceurl


Aug, 2018 - Permalink

That's strange, are you using that with a live notification or the notification test?


Kind regards,
Stephan Linke, Tech Support Team


Aug, 2018 - Permalink

yes, i'm using that with a live notification, basically want to integrate it with Microsoft Teams.

all the prerequesites were done properly and i can see the notification in the teams channel but there is no valid data like if the device is up or down, etc is displayed.


Aug, 2018 - Permalink

I'll put this to the test and let you know if it worked properly. Please pear with us.


Kind regards,
Stephan Linke, Tech Support Team


Aug, 2018 - Permalink

This works actually with %sensor on %device is in a %status state! Details Current State %status Message %message Since %since Last up %lastup Sensor prtg_sensorurl Device prtg_deviceurl Management URL %serviceurl

Did you already try the custom content option? Latest version installed?


Kind regards,
Stephan Linke, Tech Support Team


Aug, 2018 - Permalink

Hi Stephan,

This is what results with that line you wrote last:

I tested simply with the initial parameters provided in the guide:

-sensor '%sensor' -sensorID '%sensorid' -status '%status' -message '%message' -since '%since' -lastup '%lastup' -device '%device' -sensorURL '%linksensor' -deviceURL '%linkdevice' -serviceURL '%serviceurl'

and I get the following result:


Oct, 2018 - Permalink

Why not use the native MS Teams notifications? :)


PRTG Scheduler | PRTGapi | Feature Requests | WMI Issues | SNMP Issues

Kind regards,
Stephan Linke, Tech Support Team


Oct, 2018 - Permalink

Hi,

I am unsure where to locate this tbh. When accessing the Notifications, this is what I see https://i.imgur.com/ax7ZrwG.jpg


Oct, 2018 - Permalink

You'll need to create a new notification via Setup | Account Settings | Notification Templates. The option is named Send Microsoft Teams Message. It will then be available as a notification trigger.


PRTG Scheduler | PRTGapi | Feature Requests | WMI Issues | SNMP Issues

Kind regards,
Stephan Linke, Tech Support Team


Oct, 2018 - Permalink