lordmilko / PrtgAPI

C#/PowerShell interface for PRTG Network Monitor
MIT License
305 stars 38 forks source link

Bulk Import #13

Closed mkardos1 closed 6 years ago

mkardos1 commented 6 years ago

Hello lordmilko,

Have you ever tried to make an import of devices into PRTG monitoring? I tried to use auto-discovery using a list of devices, but it adds reachable devices only. I'd like to add a list of devices, where both reachable and unreachable devs are added.

Thanks!

lordmilko commented 6 years ago

Hi @mkardos1,

The first thing I did at my current job was write a script that reads a CSV and performs a bulk import of groups and devices, setting the location of each device!

The following provides a sample of how this can be done

Servers.csv

Name,State,District,Location
NY-NEWYORK,New York,NY1,"23 Fleet Street, New York, New York, USA"
NY-QUEENS,New York,NY1,"48 Queen Street, Queens, New York, USA"
NY-BRONX,New York,NY2,"35 West Street, The Bronx, New York, USA"
IL-CHICAGO,Illinois,IL1,"42 South Street, Chicago, Illinois, USA"

AddServers.ps1

if(!(Get-PrtgClient))
{
    Connect-PrtgServer prtg.contoso.local
}

# Import the CSV
$csv = Import-Csv $PSScriptRoot\Servers.csv

# Group each record by its State
$states = $csv | group State

function ProcessStates($states) {

    foreach($state in $states)
    {
        Write-Host "Processing state $($state.Name)"

        # Get this state's PRTG Probe
        $probe = Get-Probe $state.Name

        if(!$probe)
        {
            throw "Could not find probe '$($state.Name)'"
        }

        # Group each record in this state by its District
        $districts = $state.Group | group District

        ProcessDistricts $probe $districts
    }
}

function ProcessDistricts($probe, $districts) {

    foreach($district in $districts)
    {
        Write-Host "   Processing district $($district.Name)"

        # Get this district's PRTG Group
        $districtGroup = $probe | Get-Group $district.Name

        if(!$districtGroup)
        {
            # If no such group exists, create one
            $districtGroup = $probe | Add-Group $district.Name
        }

        ProcessOffices $district $districtGroup
    }
}

function ProcessOffices($district, $districtGroup) {

    foreach($office in $district.Group)
    {
        # Get this office's server
        $device = $districtGroup | Get-Device $office.Name

        if(!$device)
        {
            Write-Host "      Adding device $($office.Name)"

            # Add the device using a Host of <hostname>.<domain>
            $device = $districtGroup | Add-Device $office.Name "$($office.Name).$env:userdnsdomain".ToLower()

            # Set the location
            $device | Set-ObjectProperty Location $office.Location
        }
    }
}

ProcessStates $states

Note how I don't specify -AutoDiscover when adding the device. You'll probably want to perform auto-discoveries by passing the created devices to Start-AutoDiscovery in stages later

while($true) { Get-Device | where TotalSensors -eq 0 | Select -First 5 | Start-Autodiscovery; Sleep 300 }
mkardos1 commented 6 years ago

i am trying to connect to server using PS.. no luck.. after hitting the command i am asked for credentials and then i receive the error.. any idea?

image

lordmilko commented 6 years ago

If not otherwise specified PrtgAPI assumes HTTPS

Please try Connect-PrtgServer http://10.248.31.10

mkardos1 commented 6 years ago

no luck.. when i enter wrong credentials, i receive message about it.. but once i enter correct credentials, i always receive SSL/TLS error.. i tried http://IP/, http://IP, 'http://IP', "http://IP".. no idea what to do :(

lordmilko commented 6 years ago

It sounds like the issue is your PRTG Server has SSL enabled, however you are trying to connect via an IP Address. I was able to replicate the issue you are seeing by attempting to connect to my SSL PRTG Server by its IP Address instead of its DNS name

It is not possible to securely connect to an HTTPS server via an IP Address. If you go to https://10.248.31.10 in your web browser you will likely receive a certificate error. When connecting via HTTP, PRTG will automatically redirect you to HTTPS since you have HTTPS enabled in your PRTG Config

You either need to connect to your server via its DNS name your certificate is valid for, or modify PRTG to use HTTP instead if your environment has not been configured to use a proper hostname/SSL certificate for your server

mkardos1 commented 6 years ago

yep, there is https/ssl configured, but the server has no dns name / ssl certificate configured.. is there any way to accept the risk like with browser?

lordmilko commented 6 years ago

As the default configuration of PRTG is to use HTTP, and there is no reason to have your PRTG Server configured with HTTPS if you do not intend to use a certificate, PrtgAPI does not allow ignoring SSL errors when connecting to servers.

Since it appears there is no reason for your server to be using SSL, I recommend either switching it back to the default of HTTP or configuring a proper SSL certificate (even one signed by your domain's CA) + DNS name for your server

lordmilko commented 6 years ago

Note: if for some reason you do wish to continue using HTTPS without being properly configured to do so, it is possible to instruct .NET to ignore SSL certificate errors, which will also affect PrtgAPI

add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
    public bool CheckValidationResult(
        ServicePoint srvPoint, X509Certificate certificate,
        WebRequest request, int certificateProblem) {
        return true;
    }
}
"@
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy

Connect-PrtgServer https://10.248.31.10

However I strongly recommend modifying the config of your PRTG Server per above, as this technique will cause PowerShell to ignore all certificate errors from all HTTP/HTTPS requests for the life of the process

mkardos1 commented 6 years ago

thank you for all of your help! after some tries with SSL, i temporarily enabled HTTP and it is working now.. i made some script which is working well. thanks for inspiration :) however, i have one more question.. how can i add a device using the way of specifying parameters like

# Create a new device named "dc-1" with an IPv6 Address $params = New-DeviceParameters dc-1 "2001:db8:370:7334" $params.IPVersion = "IPv6" Get-Probe contoso | Add-Device $params

but i need to specify: name (to be displayed), DNS name (instead of IP) and device template (created to use ping sensor).. without auto-discovery.. is there something like:

$params.name = "display name" $params.hostname = "FQDN" $params.template = Get-Template MyTemplate

Another way how to ask this.. What objects are defined for class New-DeviceParameters? What can I specify? Thank you.

lordmilko commented 6 years ago

Hi @mkardos1,

If you dump the object created by the New-DeviceParameters cmdlet you will see all of the properties that can be modified

C:\> $params = New-DeviceParameters dc-1
C:\> $params

Host                  : dc-1
IPVersion             : IPv4
AutoDiscoveryMode     : Manual
AutoDiscoverySchedule : Once
DeviceTemplates       :
Name                  : dc-1
Tags                  :

You can specify a HostName, FQDN, IPv4 or IPv6 address to the Host property, just as you would in the PRTG UI

Also like in the PRTG UI, you can instruct your device parameters object to perform an auto-discovery using one or more device templates, retrieved via Get-DeviceTemplate. You cannot specify a device template and not do an auto-discovery, as that doesn't make any sense. If you want to perform an auto-discovery based on a device template after the device has been created, this can be done via the Start-AutoDiscovery cmdlet, in which case you do not need to specify any auto-discovery settings at the time of device creation.

You will notice that in the PRTG UI when you create a new object you can specify all and every property at the time of creation, however for maintainability purposes, PrtgAPI only supports specifying a limited set of properties on NewDeviceParameters objects. You can achieve the effect of setting any one of these other properties after the device has been created via the Set-ObjectProperty cmdlet

For more information on modifying properties, see the wiki

mkardos1 commented 6 years ago

hi lordmilko,

now i am facing issue with attaching a template to the device.. the way i am adding a device:

$param = New-DeviceParameters $device.Name $param.Host = $fqdn $param.DeviceTemplates = Get-DeviceTemplate customTemplate.odt $param.AutoDiscoverySchedule = "Once" $param.AutoDiscoveryMode = "AutomaticTemplate" $dev = $group | Add-Device $param

customTemplate includes only one sensor - ping.. however, the device added has no template, no sensor attached.. any idea why?

lordmilko commented 6 years ago

If you run Get-DeviceTemplate customTemplate.odt separately does it actually return anything? If not, what if you do Get-DeviceTemplate *custom*?

If you type $param before adding the device, does it show the template has been added to the parameters?

Finally, if you type $group | Add-Device $param -Verbose it will show the actual HTTP request that is executed against PRTG. Are you able to see the device template in the executed URL?

mkardos1 commented 6 years ago

to answer your questions, yes, Get-DeviceTemplate returns the template, $param includes the template as well and it is also present in the url.. but the original name of my template was not customTemplate, but it included spaces.. so once i saw it in the url it looked terrifying :) i renamed the template to SCtemplate, but the result is the same.. here is a sample from my url.. i think the devicetemplate__check is strange

ipversion=0& discoverytype=2& discoveryschedule=0& devicetemplate=1& devicetemplate__check=SCtemplate.odt%7cSCtemplate%7c%7c& id=6814

mkardos1 commented 6 years ago

once again, here is my code:

$fqdn = $device.Name + ".nitra.jlrint.com" $param = New-DeviceParameters $device.Name $param.Host = $fqdn $param.DeviceTemplates = Get-DeviceTemplate SCtemplate $param.AutoDiscoverySchedule = "Once" $param.AutoDiscoveryMode = "AutomaticTemplate" $dev = $group | Add-Device $param -Verbose $dev | Start-AutoDiscovery

and here is the full URL from verbose

VERBOSE: Performing the operation "Add-Device" on target "Device 1A (Host: ) (Destination: Zone 1 (ID: 6829))". VERBOSE: Add-Device: Synchronously executing request http://10.248.31.10/api/table.xml?content=devices&columns=location,host,group,probe,favorite,condition,upsens,downsens, downacksens,partialdownsens,warnsens,pausedsens,unusualsens,undefinedsens,totalsens,schedule,basetype,baselink,parentid ,notifiesx,interval,intervalx,access,dependency,position,status,comments,priority,message,type,tags,active,objid,name&c ount=&filter_parentid=6829&filtername=Device+1A&username=prtgadmin&passhash=3048675255 VERBOSE: Add-Device: Synchronously executing request http://10.248.31.10/adddevice2.htm?name=Device+1A&host=Device+1A.nitra.jlrint.com&ipversion=0&discoverytype=2&disco veryschedule=0&devicetemplate_=1&devicetemplate__check=SCtemplate.odt%7cSCtemplate%7c%7c&id=6829&username=prtgadmin&pa sshash=3048675255 VERBOSE: Add-Device: Synchronously executing request http://10.248.31.10/api/table.xml?content=devices&columns=location,host,group,probe,favorite,condition,upsens,downsens, downacksens,partialdownsens,warnsens,pausedsens,unusualsens,undefinedsens,totalsens,schedule,basetype,baselink,parentid ,notifiesx,interval,intervalx,access,dependency,position,status,comments,priority,message,type,tags,active,objid,name&c ount=&filter_parentid=6829&filter_name=Device+1A&username=prtgadmin&passhash=3048675255

lordmilko commented 6 years ago

That looks normal to me. %7c the HTML encoded version of a pipe character; so the actual value of devicetemplate__check is SCtemplate.odt|SCtemplate||

The next thing to check is whether you can add the new device with these settings in PRTG, In the new device creation window, specify to perform an auto-discovery with a template, and then specify the SCtemplate. You should expect to see the same issue,

You can then check the C:\ProgramData\Paessler\PRTG Network Monitor\Logs (System)\Auto Discovery Debug Log (1).log file on your PRTG Core server. If the auto-discovery is being successfully initiated, it will tell you the reason the discovery is failing. Common causes for auto-discoveries aborting is that the sensor type has a dependency on another type (such as Ping) in the ODT file and the PRTG Probe Service of the device's probe is not currently running

If you're able to add the device in PRTG but not PrtgAPI, if you can potentially run Fiddler and observe the difference in the TextView of the request against adddevice2.htm that will help tell me whether there is some potential bug that needs to be fixed. I however was able to successfully copy the Windows Generic.odt template, rename it (both the file name and the header inside it) and then after telling PRTG to reload device templates start a new auto-discovery that successfully created some sensors

mkardos1 commented 6 years ago

maaan, it is failing because i am trying to add unreal devices, hence are not reachable.. but whole idea of this script was to add devices which are not reachable so far.. what can i do now? add them and schedule to auto-discovery to discover them in the future?

mkardos1 commented 6 years ago

or can i add those devices without auto-discovery, and just associate a ping sensor?

lordmilko commented 6 years ago

You can't perform an auto-discovery on a device that is unreachable. As such, the behavior you are seeing is expected. As it appears your devices are successfully being added but those that are unreachable are not obtaining any sensors, this is also achieving the expected behavior

If however, you would like to create a bunch of new devices and create some sensors on them regardless of whether or not they are available, you don't want to use auto-discovery for this. In this scenario, you have a couple of options

  1. Use the Clone-Object cmdlet to clone an existing device that has all the sensors you want, specifying the new device name, FQDN and location for each device
  2. Use the Clone-Object cmdlet to clone an existing Ping sensor onto each of your newly created devices. This can be done very easily via the Clone From parameter set
  3. Dynamically create a set of sensor parameters for creating a ping sensor from an existing device that is online (such as the Probe Device if you have no others) and then use those parameters to create a new ping sensor on all of the new devices, regardless of whether they are online or not. Those that are offline will simply have their ping sensors go Down after PRTG starts probing them
  4. Continue using your current implementation, performing a Start-AutoDiscovery <template name> on unreachable devices at a later date (potentially identified by the fact their TotalSensors are equal to 0)

See the following wiki pages for more information on these topics

lordmilko commented 6 years ago

The following is an example of how you might create a ping sensor from scratch on all of your newly created devices

$pingParams = Get-Device -Id 40 | New-SensorParameters -RawType ping

$newDevices | Add-Sensor $pingParams
mkardos1 commented 6 years ago

You rock, lordmilko!

I removed everything related to auto-discovery and used cloning ping sensor to the device i just created. Now everything seems working. The only thing is that it takes let's say 8 secs to add a device. I don't know if this is expected behavior, but it doesn't matter as the script is working on a background. Now I am prepared to import 1500 devices :)

Thanks for all your help. Good luck!

lordmilko commented 6 years ago

Hi @mkardos1,

Glad to hear you got it working

FYI, on a large install, when cloning there will be a delay while PrtgAPI waits for PRTG to completely create the object. If you don't need to manipulate the created object, you can speed up cloning requests by specifying -Resolve:$false to the Clone-Object cmdlet. In addition, it is worth noting the most performant way of creating sensors will likely be via a set of sensor parameters (demonstrated above).

If you have any further issues or questions feel free to open another issue!

Regards, lordmilko

mbensaid23 commented 5 years ago

Bonjour @mkardos1 @lordmilko ,

je travaille dans une entreprise ou on utilise Nagios comme outils de supervision , maintenant on a va basculer en PRTG, et comme on a un peut prêt plus 500 équipement c'est difficile de les entrer manuellement, donc je voulez bien savoir comment intégrer un CSV qui contient une extraction des équipement du nagios en PRTG (Name, type équipement ou groupe, adresse ip). Merci d'avance.

lordmilko commented 5 years ago

@mbensaid23,

  1. This question has nothing to do with this issue. If you have a new question, please create a separate issue
  2. I do not speak French; please ask your question in English
  3. All the information you need to use PrtgAPI is contained on the wiki. You may also want to view some of the blog posts Paessler have done about PrtgAPI
mkardos1 commented 5 years ago

Hi,

I did a powershell script to import devices from the .csv file like the attached one.

Imagine the zone is like a group of devices..

If you are interested, I can share it with you.

-- Regards, Martin

mbensaid23 commented 5 years ago

Yes, I'm interested, I'd like you to share it with me. Thank you. Regards

Le mer. 16 oct. 2019 à 13:04, mkardos1 notifications@github.com a écrit :

Hi,

I did a powershell script to import devices from the .csv file like the attached one.

Imagine the zone is like a group of devices..

If you are interested, I can share it with you.

-- Regards, Martin

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lordmilko/PrtgAPI/issues/13?email_source=notifications&email_token=ANQCU2XKQY3YDDLHCG7NYRDQO3YL3A5CNFSM4E35V4L2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBMCPJA#issuecomment-542648228, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANQCU2RHDKKRC2DDPIIY3MTQO3YL3ANCNFSM4E35V4LQ .

--

Cdt

Mohammed BENSAID

mkardos1 commented 5 years ago

hi, attahced is a script and an input file for your reference. script.txt - you need to change to use the extension .ps1 as gmail is blocking executable files. also, you need to download a PrtgAPI to use the script. i believe, you can google it.. it is a long time ago, so not sure what the script exactly does, because i needed to edit it several times based on requirements.. you can use it as a starting point :) enjoy

martin

st 16. 10. 2019 o 13:04 Martin Kardos martin.kardos.hc@gmail.com napísal(a):

Hi,

I did a powershell script to import devices from the .csv file like the attached one.

Imagine the zone is like a group of devices..

If you are interested, I can share it with you.

-- Regards, Martin

-- S pozdravom, Martin Kardos

Author: Martin Kardos

Date: 25/04/2018

This script was created to import devices into PRTG based on input csv file.

It reads groups to which devices should be added and creates the group if not present already under staticaly defined parent group (Script123).

Then reads devices and adds them to the monitoring if not present already. Device is added with staticaly define domain (.XXX.YYY.com) or with IP and the only sensor - ping.

Possible issues:

- ping sensor is cloned from the existing sensor with id 2048. If the sensor is removed from PRTG, sensor adding will fail.

Possible improvements:

- Domain, parent group specification in the input csv file.

- Sensor association not depending on existing object.

The author is not responsible for anything this script will cause to your PRTG.

Use only if you know what your are doing. Use with caution. Live long and prosper.

Write-Host "" Import-Module C:\PrtgAPI # imports PrtgAPI module to PowerShell Write-Host " Module PrtgAPI imported."

if(!(Get-PrtgClient)) { # connects to the PRTG server if not already Connect-PrtgServer SERVERNAME/IP (New-Credential USER PASSWORD) } if(Get-PrtgClient) { Write-Host " PRTG server connected." } else { throw "Error: Could not connect to the PRTG server!" }

$ping = Get-Sensor -Id 2048 # gets ping sensor to be cloned, change this to the existing object id $csv = Import-Csv $PSScriptRoot\input.csv # imports the CSV file $zones = $csv | group Zone # groups records by zones Write-Host " Input data loaded."

function ProcessZones($zones) { # processes zones

foreach($zone in $zones) {

    Write-Host ""
        Write-Host " ***** ZONE $($zone.Name) ******"
    Write-Host ""

    $group = Get-Group $zone.Name # checks for the group on server (group in PRTG = zone name)

    if (!$group) { # if group does not exist in PRTG, creates one

        Write-Host " Could not find group for zone $($zone.Name).. Creating.."
        $parentgroup = Get-Group "Script123"

        if (!$parentgroup) {
            throw "Error: Could not find Script123 group!"
        }

        $group = $parentgroup | Add-Group $zone.Name # adds group
        Write-Host " Group for zone $($zone.Name) created successfully."

    } else {
        Write-Host " Using existing group for zone $($zone.Name).."
    }

    $devices = $zone.Group | group Name # groups devices under the same zone
    $ips = $zone.Group | group IP # groups IPs under the same zone
    ProcessDevices $devices $ips $group
}

}

function ProcessDevices($devices, $ips, $group) { # processes devices

for($i=0; $i -lt $devices.Count; $i++) {

    $dev = Get-Device $devices[$i].Name # checks for the device on server
    if (!$dev) { # if the devices does not exist, creates one

        #$fqdn = $device.Name + ".XXX.YYY.com" # prepares fqdn
        $dev = $group | Add-Device $devices[$i].Name $ips[$i].Name # adds device with name and fqdn or IP
        $ping | Clone-Object $dev.ID | Resume-Object # clones ping sensor to the device and resuming it

        if ($dev) {
            Write-Host " Device $($devices[$i].Name) successfully added."
        } else {
            Write-Host " Error: Device $($devices[$i].Name) not added."
        }

    } else {
        Write-Host " Device $($ips[$i].Name) already exists, skipping.."
    }
}

}

ProcessZones $zones # main function

Disconnect-PrtgServer # disconnects from the server

Write-Host "" Write-Host " *****" Write-Host "" Write-Host " PRTG server disconnected." Write-Host " Job done!" Write-Host ""

End of the script

mbensaid23 commented 5 years ago

hello,

thank you for your script, but I have not understood everything, please can you help me I really need help on this subject, in fact what I'm looking for is a script that adds them equipment based on three elements (Name, type, ip address). Can you help me please .

Best regards

Le jeu. 17 oct. 2019 à 08:03, mkardos1 notifications@github.com a écrit :

hi, attahced is a script and an input file for your reference. script.txt - you need to change to use the extension .ps1 as gmail is blocking executable files. also, you need to download a PrtgAPI to use the script. i believe, you can google it.. it is a long time ago, so not sure what the script exactly does, because i needed to edit it several times based on requirements.. you can use it as a starting point :) enjoy

martin

st 16. 10. 2019 o 13:04 Martin Kardos martin.kardos.hc@gmail.com napísal(a):

Hi,

I did a powershell script to import devices from the .csv file like the attached one.

Imagine the zone is like a group of devices..

If you are interested, I can share it with you.

-- Regards, Martin

-- S pozdravom, Martin Kardos

Author: Martin Kardos

Date: 25/04/2018

#

This script was created to import devices into PRTG based on input csv

file.

It reads groups to which devices should be added and creates the group

if not present already under staticaly defined parent group (Script123).

Then reads devices and adds them to the monitoring if not present

already. Device is added with staticaly define domain (.XXX.YYY.com) or with IP and the only sensor - ping. #

Possible issues:

- ping sensor is cloned from the existing sensor with id 2048. If the

sensor is removed from PRTG, sensor adding will fail.

Possible improvements:

- Domain, parent group specification in the input csv file.

- Sensor association not depending on existing object.

#

The author is not responsible for anything this script will cause to

your PRTG.

Use only if you know what your are doing. Use with caution. Live long

and prosper.

Write-Host "" Import-Module C:\PrtgAPI # imports PrtgAPI module to PowerShell Write-Host " Module PrtgAPI imported."

if(!(Get-PrtgClient)) { # connects to the PRTG server if not already Connect-PrtgServer SERVERNAME/IP (New-Credential USER PASSWORD) } if(Get-PrtgClient) { Write-Host " PRTG server connected." } else { throw "Error: Could not connect to the PRTG server!" }

$ping = Get-Sensor -Id 2048 # gets ping sensor to be cloned, change this to the existing object id $csv = Import-Csv $PSScriptRoot\input.csv # imports the CSV file $zones = $csv | group Zone # groups records by zones Write-Host " Input data loaded."

function ProcessZones($zones) { # processes zones

foreach($zone in $zones) {

Write-Host "" Write-Host " * ZONE $($zone.Name) **" Write-Host ""

$group = Get-Group $zone.Name # checks for the group on server (group in PRTG = zone name)

if (!$group) { # if group does not exist in PRTG, creates one

Write-Host " Could not find group for zone $($zone.Name).. Creating.." $parentgroup = Get-Group "Script123"

if (!$parentgroup) { throw "Error: Could not find Script123 group!" }

$group = $parentgroup | Add-Group $zone.Name # adds group Write-Host " Group for zone $($zone.Name) created successfully."

} else { Write-Host " Using existing group for zone $($zone.Name).." }

$devices = $zone.Group | group Name # groups devices under the same zone $ips = $zone.Group | group IP # groups IPs under the same zone ProcessDevices $devices $ips $group } }

function ProcessDevices($devices, $ips, $group) { # processes devices

for($i=0; $i -lt $devices.Count; $i++) {

$dev = Get-Device $devices[$i].Name # checks for the device on server if (!$dev) { # if the devices does not exist, creates one

$fqdn = $device.Name + ".XXX.YYY.com" # prepares fqdn

$dev = $group | Add-Device $devices[$i].Name $ips[$i].Name # adds device with name and fqdn or IP $ping | Clone-Object $dev.ID | Resume-Object # clones ping sensor to the device and resuming it

if ($dev) { Write-Host " Device $($devices[$i].Name) successfully added." } else { Write-Host " Error: Device $($devices[$i].Name) not added." }

} else { Write-Host " Device $($ips[$i].Name) already exists, skipping.." } } }

ProcessZones $zones # main function

Disconnect-PrtgServer # disconnects from the server

Write-Host "" Write-Host " *****" Write-Host "" Write-Host " PRTG server disconnected." Write-Host " Job done!" Write-Host ""

End of the script

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lordmilko/PrtgAPI/issues/13?email_source=notifications&email_token=ANQCU2SIPFMLHNEJQUJBY5DQO754FA5CNFSM4E35V4L2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBO4Z6I#issuecomment-543018233, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANQCU2U33SOJE3YXBDVKHNDQO754FANCNFSM4E35V4LQ .

--

Cdt

Mohammed BENSAID

lordmilko commented 5 years ago

@mbensaid23,

PrtgAPI is a programming framework for developing custom applications for PRTG. Aided by the wiki, you are expected to apply yourself in order to achieve this goal, regardless of your level of programming experience.

From what I'm seeing, it appears you have no interest in doing that, and you simply want someone to hand you a ready-to-go solution you can just run against your environment. You clearly haven't read any of the sample code that has been provided to you; if you had you would see that basically almost completely achieves what you're looking for.

While I can't speak for @mkardos1, I am not going to develop your entire application for you. I encourage you to take this sample code and then read the wiki in order to make the additional adjustments you feel are required.

If you then have a specific question you feel is not covered by the wiki, I'll be happy to help.

mbensaid23 commented 5 years ago

Hello, @lordmilko/PrtgAPI reply@reply.github.com

Thank you for your reply, I never asked you to develop an application for me, I asked @mkardos1 for an example so that I could be inspired to reproduce my script. but thank you for the support.

Regards

Le jeu. 17 oct. 2019 à 23:50, lordmilko notifications@github.com a écrit :

@mbensaid23 https://github.com/mbensaid23,

PrtgAPI is a programming framework for developing custom applications for PRTG. Aided by the wiki https://github.com/lordmilko/PrtgAPI/wiki, you are expected to apply yourself in order to achieve this goal, regardless of your level of programming experience.

From what I'm seeing, it appears you have no interest in doing that, and you simply want someone to hand you a ready-to-go solution you can just run against your environment. You clearly haven't read any of the sample code that has been provided to you; if you had you would see that basically almost completely achieves what you're looking for.

While I can't speak for @mkardos1 https://github.com/mkardos1, I am not going to develop your entire application for you. I encourage you to take this sample code https://blog.paessler.com/how-to-add-hundreds-of-devices-to-prtg and then read the wiki https://github.com/lordmilko/PrtgAPI/wiki in order to make the additional adjustments you feel are required.

If you then have a specific question you feel is not covered by the wiki, I'll be happy to help.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lordmilko/PrtgAPI/issues/13?email_source=notifications&email_token=ANQCU2VDU4J55532LKI2JOTQPDM3ZA5CNFSM4E35V4L2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBRUJMI#issuecomment-543376561, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANQCU2QQMDJZ2AI32JTUVV3QPDM3ZANCNFSM4E35V4LQ .

--

Cdt

Mohammed BENSAID

mkardos1 commented 5 years ago

hi,

please contact me on my personal email - martin.kardos.hc@gmail.com what do you mean by type? is it like some prtg object or type - router/switch/etc ?

martin