{"action":"created","issue":{"url":"https://api.github.com/repos/lordmilko/PrtgAPI/issues/44","repository_url":"https://api.github.com/repos/lordmilko/PrtgAPI","labels_url":"https://api.github.com/repos/lordmilko/PrtgAPI/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/lordmilko/PrtgAPI/issues/44/comments","events_url":"https://api.github.com/repos/lordmilko/PrtgAPI/issues/44/events","html_url":"https://github.com/lordmilko/PrtgAPI/issues/44","id":371419359,"node_id":"MDU6SXNzdWUzNzE0MTkzNTk=","number":44,"title":"Create WmiRemotePing","user":{"login":"eternia","id":188011,"node_id":"MDQ6VXNlcjE4ODAxMQ==","avatar_url":"https://avatars1.githubusercontent.com/u/188011?v=4","gravatar_id":"","url":"https://api.github.com/users/eternia","html_url":"https://github.com/eternia","followers_url":"https://api.github.com/users/eternia/followers","following_url":"https://api.github.com/users/eternia/following{/other_user}","gists_url":"https://api.github.com/users/eternia/gists{/gist_id}","starred_url":"https://api.github.com/users/eternia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eternia/subscriptions","organizations_url":"https://api.github.com/users/eternia/orgs","repos_url":"https://api.github.com/users/eternia/repos","events_url":"https://api.github.com/users/eternia/events{/privacy}","received_events_url":"https://api.github.com/users/eternia/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-10-18T08:37:10Z","updated_at":"2018-10-18T09:52:07Z","closed_at":null,"author_association":"NONE","body":"Hi ! How to create a wmiremoteping sensor in device (powershell) ? I have no idead to add the target (ip) parameters on this sensor"},"comment":{"url":"https://api.github.com/repos/lordmilko/PrtgAPI/issues/comments/430947723","html_url":"https://github.com/lordmilko/PrtgAPI/issues/44#issuecomment-430947723","issue_url":"https://api.github.com/repos/lordmilko/PrtgAPI/issues/44","id":430947723,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMDk0NzcyMw==","user":{"login":"lordmilko","id":6138789,"node_id":"MDQ6VXNlcjYxMzg3ODk=","avatar_url":"https://avatars0.githubusercontent.com/u/6138789?v=4","gravatar_id":"","url":"https://api.github.com/users/lordmilko","html_url":"https://github.com/lordmilko","followers_url":"https://api.github.com/users/lordmilko/followers","following_url":"https://api.github.com/users/lordmilko/following{/other_user}","gists_url":"https://api.github.com/users/lordmilko/gists{/gist_id}","starred_url":"https://api.github.com/users/lordmilko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lordmilko/subscriptions","organizations_url":"https://api.github.com/users/lordmilko/orgs","repos_url":"https://api.github.com/users/lordmilko/repos","events_url":"https://api.github.com/users/lordmilko/events{/privacy}","received_events_url":"https://api.github.com/users/lordmilko/received_events","type":"User","site_admin":false},"created_at":"2018-10-18T09:52:07Z","updated_at":"2018-10-18T09:52:07Z","author_association":"OWNER","body":"The Sensor Creation page mentions that\r\n\r\n> PrtgAPI only includes native support for a limited subset of this range. For all other sensor types, PrtgAPI defines an interface that allows custom sensor parameters to be [generated](https://github.com/lordmilko/PrtgAPI/wiki/Dynamic-Parameters) and created.\r\n\r\nThe [Dynamic Parameters](https://github.com/lordmilko/PrtgAPI/wiki/Dynamic-Parameters#powershell) page describes the process of creating arbitrary sensor types as a three step process\r\n1. Identify the sensor type\r\n2. Create the sensor parameters\r\n3. Apply the parameters to one or more objects\r\n\r\nFor a WMI Remote Ping sensor, we can retrieve the raw sensor type from an arbitrary device\r\n\r\n```powershell\r\nPS C:\\> get-device -count 1|get-sensortype *ping*\r\n\r\nId             Name             Description\r\n--             ----             -----------\r\ncloudping      Cloud Ping       Monitors the Ping t\r\nping           Ping             Monitors connectivi\r\nptfpingjitter  Ping Jitter      Monitors the Statis\r\nsipoptionsping SIP Options Ping Monitors connectivi\r\nsshremoteping  SSH Remote Ping  Remotely monitors t\r\nwmiremoteping  WMI Remote Ping  Remotely monitors t\r\n```\r\n\r\nNow that we know the raw type name is *wmiremoteping*, we can construct a set of dynamic sensor parameters\r\n\r\n```powershell\r\nPS C:\\> $params = get-device -count 1|New-SensorParameters -rawtype wmiremoteping\r\nPS C:\\> $params\r\n\r\n\r\ntargetaddress     :\r\ntimeout           : 5\r\nbuffersize        : 32\r\nTargets           : {}\r\nSource            : Probe Device\r\nSensorType        : wmiremoteping\r\nPriority          : Three\r\nInheritTriggers   : True\r\nInheritInterval   : True\r\nInterval          : 00:01:00\r\nIntervalErrorMode : OneWarningThenDown\r\nName              : Remote Ping\r\nTags              : {pingsensor, wmisensor, wmipingsensor, remotepingsensor}\r\nCookie            : False\r\n```\r\n\r\nIf you have a look at the properties contained in the `DynamicSensorParameters` object, you will see there is a `targetaddress` property. This most likely corresponds to the *Target* property we are looking for\r\n\r\n```powershell\r\nPS C:\\> $params.targetaddress = \"google.com\"\r\nPS C:\\> get-device -count 1 | add-sensor $params\r\n\r\nName                         Id     Device\r\n----                         --     ------\r\nRemote Ping                  8045   Probe Device\r\n```\r\nIf we then open the device in our web browser we can see that the sensor has been successfully created\r\n\r\nAre you able to advise whether this resolves your query?\r\n\r\nRegards,\r\nlordmilko"}}
{"actor":{"display_login":"lordmilko"}}