Hello,
for Clients that we only reach by Teamviewer it would be great to have a sensor which checks the availability (online, offline, etc.) of the corresponding ID.
I don't know if thats technically even possible but I think it would be a great addition to make sure all systems are online. Or is there already a way to do it?
Thank you very much and best regards, Sommer.
Article Comments
Hi there,
This is not an official feature request, just a guidance by Luciano to come up with a solution. Until now we don't have a working sensor or script to achieve that though.
Best regards.
Apr, 2019 - Permalink
Hi there,
I am really not sure what you mean by "Explain on fingers how to implement it.". Could you further elaborate?
Best regards.
May, 2019 - Permalink
I have Teamviewer API Token. I can make a device request using the PowerShell Studio Module, but I need to do this GET request from PRTG. I can not understand how to do this, because the Teamviewer API differs from the standard and the Token is not used in the request link.
May, 2019 - Permalink
Hi there,
To do this you will need to write a PowerShell Script (Invoke-WebRequest):
https://helpdesk.paessler.com/en/support/solutions/articles/76000041700-guide-for-powershell-based-custom-sensors
Best regards.
May, 2019 - Permalink
PowerShell Script request:
<# .SYNOPSIS Set Teamviewer Token for All Other Functions, Also Test the connection to Teamviewer API .DESCRIPTION Use to Set Teamviewer Token For All Other Functions. Will Also use the GET /api/v1/ping API Function .PARAMETER UserToken Is the User Level Token that you can create from the Teamviewer Management Console Use Script and Not App Token and User not Company Token. .EXAMPLE PS C:\> Set-TVToken -UserToken $value1 .NOTES For more Details see Teamviewer API token Documentation https://www.teamviewer.com/en/for-developers/teamviewer-api/ https://dl.tvcdn.de/integrate/TeamViewer_API_Documentation.pdf #> function Set-TVToken { [CmdletBinding(ConfirmImpact = 'Medium', PositionalBinding = $false, SupportsPaging = $true, SupportsShouldProcess = $true)] param ( [Parameter(Mandatory = $true)] [Alias('Token')] [string]$UserToken ) $header = New-Object "System.Collections.Generic.Dictionary[[String],[String]]" $header.Add("authorization", "Bearer $UserToken") $TokenTest = Invoke-RestMethod -Uri "https://webapi.teamviewer.com/api/v1/ping" -Method GET -Headers $header -ContentType application/json if ($TokenTest.token_valid -eq $true) { Write-Output "Teamviewer Token Is Working and Set" $global:TVToken = $UserToken } else { Write-Output "Teamviewer Token not working" } } .SYNOPSIS Gets All Teamviewer Device Info from Alias Can be Portion of the alias .DESCRIPTION Get all possible information of a Device from it's alias .PARAMETER alias Is the Name of the Device seen in all console .PARAMETER token Is the User Level Token that you can create from the Teamviewer Management Console Can use Set-TVToken Function will then not be nessessary to use this paramameter .EXAMPLE PS C:\> Get-TVDeviceInfoFromAlias -alias $value1 .NOTES For more Details see Teamviewer API token Documentation https://www.teamviewer.com/en/for-developers/teamviewer-api/ https://dl.tvcdn.de/integrate/TeamViewer_API_Documentation.pdf #> function Get-TVDeviceInfoFromAlias { [CmdletBinding(ConfirmImpact = 'Medium', PositionalBinding = $false, SupportsPaging = $true, SupportsShouldProcess = $true)] param ( [Parameter(Mandatory = $true)] $alias, $token ) if($token) {} elseif ($global:TVToken) { $token = $global:TVToken } else { Write-Output "You need to Set the Token" break } $header = New-Object "System.Collections.Generic.Dictionary[[String],[String]]" $header.Add("authorization", "Bearer $token") $Device = Invoke-RestMethod -Uri "https://webapi.teamviewer.com/api/v1/devices?full_list=true" -Method GET -Headers $header -ContentType application/json $DeviceInformation = $Device.devices | Where-Object { $_.alias -like "*$alias*" } $DeviceInformation }
Answer :
remotecontrol_id : r359023409 device_id : d895162687 alias : fts groupid : g113852238 online_state : Online assigned_to : False supported_features : remote_control, chat
How can I describe the answer in this .ps1 request?
#region: XML Output Write-Verbose "XML Output..." ...
May, 2019 - Permalink
Hi there,
In case you wonder what the output for PRTG should look like, please check the corresponding manual for this:
https://www.paessler.com/manuals/prtg/custom_sensors
Best regards.
May, 2019 - Permalink
I was looking for an example of output "Ok" status. Not found. Someone show how to transfer the status of the XML format?
Jun, 2019 - Permalink
Hi there,
Please check how the output should look like for the Advanced Sensor:
https://www.paessler.com/manuals/prtg/custom_sensors#advanced_sensors
A simple "Ok" would be the following:
<prtg> <result> <channel>First channel</channel> <value>10</value> </result> <result> <channel>Second channel</channel> <value>20</value> </result> </prtg>
Best regards.
Jun, 2019 - Permalink
Sensor gets code: PE231
If the answer contains the string:
online_state : Online
or
online_state : Offline
what then is the XML Output for PRTG?
Jun, 2019 - Permalink
Hi there,
You will need to write a proper output as PRTG can't possibly know what "online_state : Offline" means. As displayed above, you can see sample output for PRTG in an XML format.
The best way would be to put the output into a number-based context, an example with limits (you can also use a value lookup)
$mysupercoolvariable = "Online" if ($mysupercoolvariable -eq "Online"){ $value = 0 } elseif ($mysupercoolvariable -eq "Offline"){ $value = 1 } else { $value = -1 } Write-Host @" <prtg> <result> <channel>Status</channel> <value>$($value)</value> <LimitMode>1</LimitMode> <LimitMaxError>0</LimitMaxError> <LimitMinError>0</LimitMinError> </result> <text>The current status is: $($mysupercoolvariable)</text> </prtg> "@
Best regards.
Jun, 2019 - Permalink
<# .NOTES -------------------------------------------------------------------------------- Code generated by: K0NCTANT1N (k0nctant1n@outlook.com) Generated on: 2019-06-06 8:27 PM Generated by: K0NCTANT1N Filename: TeamViewerDeviceStatus.ps1 VERSION: 1.2 -------------------------------------------------------------------------------- .DESCRIPTION Script generated by K0NCTANT1N using TeamViewerPSModules from PowerShell Studio 2019 #> <# .SYNOPSIS Powershell script to monitor the Status Devices from TeamViewer using PRTG .DESCRIPTION This script is intended to be used with PRTG Network Monitor (as a custom "EXE/Script Advanced" sensor). It will return the Status Teamviewer Device from TeamViewer. .PARAMETER UserToken To create the API token with User level, please do the following: Sign in with your TeamViewer account on the Management Console (www.login.teamviewer.com) Open Management Console -> Edit profile -> Apps -> Create script token. Add the permission View for Computers & Contacts. Use Script and Not App Token and User not Company Token. .PARAMETER Alias Is the Name of the Device seen in Teamviewer Management Console .EXAMPLE #PS C:\> TeamViewerDeviceStatus.ps1 "$UserToken" "$Alias" .NOTES You must download and install the Powershell Module To manage Teamviewer: https://www.powershellgallery.com/packages/TeamViewerPSModules/1.3.0.0 This script must be placed into the folder: C:\Program Files\PRTG Network Monitor\Custom Sensors\EXEXML Now you can add a new “EXE/Script Advanced” sensor (I would recommend adding the sensor to the probe device) and select TeamViewerDeviceStatus.ps1” in the dropdown for the “EXE/Script” setting. .LINK Topic link: https://helpdesk.paessler.com/en/support/solutions/articles/76285-feature-request-teamviewer-sensor #> Param ( [string]$UserToken, [string]$Alias ) <# .SYNOPSIS Set Teamviewer Token for All Other Functions, Also Test the connection to Teamviewer API .DESCRIPTION Use to Set Teamviewer Token For All Other Functions. Will Also use the GET /api/v1/ping API Function .PARAMETER UserToken Is the User Level Token that you can create from the Teamviewer Management Console Use Script and Not App Token and User not Company Token. .EXAMPLE #PS C:\> Set-TVToken -UserToken $value1 .NOTES For more Details see Teamviewer API token Documentation https://www.teamviewer.com/en/for-developers/teamviewer-api/ https://dl.tvcdn.de/integrate/TeamViewer_API_Documentation.pdf #> Set-TVToken -UserToken $UserToken <# .SYNOPSIS Gets All Teamviewer Device Info from Alias Can be Portion of the alias .DESCRIPTION Get all possible information of a Device from it's alias .PARAMETER alias Is the Name of the Device seen in all console .PARAMETER token Is the User Level Token that you can create from the Teamviewer Management Console Can use Set-TVToken Function will then not be nessessary to use this paramameter .EXAMPLE PS C:\> Get-TVDeviceInfoFromAlias -alias $value1 .NOTES For more Details see Teamviewer API token Documentation https://www.teamviewer.com/en/for-developers/teamviewer-api/ https://dl.tvcdn.de/integrate/TeamViewer_API_Documentation.pdf #> $StatusVariable = Get-TVDeviceInfoFromAlias -alias $Alias if ($StatusVariable | ?{ $_.online_state -eq "Online"}){ $value = 0 } elseif ($StatusVariable | ?{ $_.online_state -eq "Offline"}){ $value = 1 } else { $value = -1 } <# Write Results XML Output... #> Write-Host "<prtg>" "<result>" "<channel>Status</channel>" "<value>$($value)</value>" "<LimitMaxError>0</LimitMaxError>" "<LimitMinError>-1</LimitMinError>" "<LimitMode>1</LimitMode>" "</result>" "<text>Last message: $($StatusVariable)</text>" Write-Host "</prtg>"
Jun, 2019 - Permalink
Hello,
we appreciate your contact and feedback.
There are currently no plans for a team-viewer specific sensor at the present time, but by checking their documentation this should be possible. Please have a look at:
Specifically, in the TeamViewer_API_Documentation.pdf available in the second link documents the following function:
That returns a list of sessions, which reports among other things:
I believe that this is the information you're after. You'll need to sort the authentication which involves oAuth, but based on this API documentation, it should be possible using PRTG's support for custom sensors:
Best Regards,
Luciano Lingnau [Paessler Support]
Oct, 2017 - Permalink