Closed sysadmin24 closed 3 years ago
Hi @sysadmin24,
Under Property Manipulation on the wiki, you'll see it links to the document you see if you run Get-Help about_ObjectSettings
in PowerShell. In this article, you'll see that PrtgAPI currently natively only supports getting the DependencyType, but not setting it (this is because when you set any property under the Schedules, Dependencies and Maintenance Window section, other properties you didn't specify become unset). As this is a difficult problem to deal with in a performant manner, PrtgAPI currently only supports modifying this property via the Raw API.
Please see #148 for information on how to do this
Regards, lordmilko
Thank you!
Describe the bug
Hi , First off this PS module is great! Thanks so much for this.
I've having trouble changing a specific sensor "Ping" the Property DependencyType. I want to change from Parent to MasterObject, so this sensor becomes the master object for the parent device. I can change other properties like the "Interval"
Properties of the sensor =
TypeName: PrtgAPI.SensorSettings
Name MemberType Definition
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetType Method type GetType()
ToString Method string ToString()
AutoAcknowledge Property System.Nullable[bool] AutoAcknowledge {get;set;}
BandwidthSpeedUnit Property System.Nullable[PrtgAPI.DataUnit] BandwidthSpeedUnit {get;set;}
BandwidthTimeUnit Property System.Nullable[PrtgAPI.TimeUnit] BandwidthTimeUnit {get;set;}
BandwidthVolumeUnit Property System.Nullable[PrtgAPI.DataVolumeUnit] BandwidthVolumeUnit {get;set;}
ChannelDefinition Property string[] ChannelDefinition {get;set;}
Database Property string Database {get;set;}
DebugMode Property System.Nullable[PrtgAPI.DebugMode] DebugMode {get;set;}
DependencyDelay Property System.Nullable[int] DependencyDelay {get;set;}
DependencyType Property System.Nullable[PrtgAPI.DependencyType] DependencyType {get;set;}
DependentObjectId Property System.Nullable[int] DependentObjectId {get;set;}
DiskSizeUnit Property System.Nullable[PrtgAPI.DataVolumeUnit] DiskSizeUnit {get;set;}
ExeFile Property PrtgAPI.Targets.ExeFileTarget ExeFile {get;}
ExeParameters Property string ExeParameters {get;set;}
FactoryErrorFormula Property string FactoryErrorFormula {get;set;}
FactoryErrorMode Property System.Nullable[PrtgAPI.FactoryErrorMode] FactoryErrorMode {get;set;}
FactoryMissingDataMode Property System.Nullable[PrtgAPI.FactoryMissingDataMode] FactoryMissingDataMode {get;set;} FileSizeUnit Property System.Nullable[PrtgAPI.DataVolumeUnit] FileSizeUnit {get;set;}
GraphType Property PrtgAPI.GraphType GraphType {get;set;}
HasProxyPassword Property bool HasProxyPassword {get;}
HttpRequestMethod Property System.Nullable[PrtgAPI.HttpRequestMethod] HttpRequestMethod {get;set;}
InheritAccess Property System.Nullable[bool] InheritAccess {get;set;}
InheritChannelUnit Property System.Nullable[bool] InheritChannelUnit {get;set;}
InheritDependency Property System.Nullable[bool] InheritDependency {get;set;}
InheritInterval Property System.Nullable[bool] InheritInterval {get;set;}
InheritProxy Property System.Nullable[bool] InheritProxy {get;set;}
InstanceName Property string InstanceName {get;set;}
Interval Property PrtgAPI.ScanningInterval Interval {get;}
IntervalErrorMode Property System.Nullable[PrtgAPI.IntervalErrorMode] IntervalErrorMode {get;set;}
MaintenanceEnabled Property System.Nullable[bool] MaintenanceEnabled {get;set;}
MaintenanceEnd Property System.Nullable[datetime] MaintenanceEnd {get;}
MaintenanceStart Property System.Nullable[datetime] MaintenanceStart {get;}
MemoryUsageUnit Property System.Nullable[PrtgAPI.DataVolumeUnit] MemoryUsageUnit {get;set;}
MonitorPerformance Property System.Nullable[bool] MonitorPerformance {get;set;}
Mutex Property string Mutex {get;set;}
Name Property string Name {get;set;}
NotifyChanged Property System.Nullable[bool] NotifyChanged {get;set;}
ParentTags Property string[] ParentTags {get;set;}
PingCount Property System.Nullable[int] PingCount {get;set;}
PingDelay Property System.Nullable[int] PingDelay {get;set;}
PingMode Property System.Nullable[PrtgAPI.PingMode] PingMode {get;set;}
PingPacketSize Property System.Nullable[int] PingPacketSize {get;set;}
PingRemotePacketSize Property System.Nullable[int] PingRemotePacketSize {get;set;}
PostContentType Property string PostContentType {get;set;}
PostData Property string PostData {get;set;}
Priority Property System.Nullable[PrtgAPI.Priority] Priority {get;set;}
ProxyAddress Property string ProxyAddress {get;set;}
ProxyPort Property System.Nullable[int] ProxyPort {get;set;}
ProxyUser Property string ProxyUser {get;set;}
Schedule Property PrtgAPI.Schedule Schedule {get;}
ServiceName Property string ServiceName {get;set;}
SetExeEnvironmentVariables Property System.Nullable[bool] SetExeEnvironmentVariables {get;set;}
SqlEncryptionMode Property System.Nullable[PrtgAPI.SqlEncryptionMode] SqlEncryptionMode {get;set;}
SqlInputParameter Property string SqlInputParameter {get;set;}
SqlTransactionMode Property System.Nullable[PrtgAPI.SqlTransactionMode] SqlTransactionMode {get;set;}
StartStopped Property System.Nullable[bool] StartStopped {get;set;}
Tags Property string[] Tags {get;set;}
Target Property string Target {get;set;}
Timeout Property System.Nullable[int] Timeout {get;set;}
Url Property string Url {get;set;}
UseCustomInstance Property System.Nullable[bool] UseCustomInstance {get;set;}
UseCustomPostContent Property System.Nullable[bool] UseCustomPostContent {get;set;}
UseSNIFromUrl Property System.Nullable[bool] UseSNIFromUrl {get;set;}
UseSqlInputParameter Property System.Nullable[bool] UseSqlInputParameter {get;set;}
UseWindowsAuthentication Property System.Nullable[bool] UseWindowsAuthentication {get;set;}
WmiMode Property System.Nullable[PrtgAPI.WmiMode] WmiMode {get;set;}
Here is the error provided:
Set-ObjectProperty : Cannot bind parameter 'Property'. Cannot convert value "DependencyType" to type "PrtgAPI.ObjectProperty". Error: "Unable to match the identifier name DependencyType to a valid enumerator name. Specify one of the following enumerator names and try again: Active, InheritLocation, Location, LocationName, InheritWindowsCredentials, WindowsDomain, WindowsUserName, WindowsPassword, InheritLinuxCredentials, LinuxUserName, LinuxLoginMode, LinuxPassword, LinuxPrivateKey, WbemProtocolMode, WbemPortMode, WbemPort, SSHPort, SSHElevationMode, SSHElevationSuUser, SSHElevationSudoUser, SSHElevationPassword, SSHEngine, InheritVMwareCredentials, VMwareUserName, VMwarePassword, VMwareProtocol, VMwareSessionMode, InheritSNMPCredentials, SNMPVersion, SNMPCommunityStringV1, SNMPCommunityStringV2, SNMPv3AuthType, SNMPv3UserName, SNMPv3Password, SNMPv3EncryptionType, SNMPv3EncryptionKey, SNMPv3Context, SNMPPort, SNMPTimeout, InheritDBCredentials, DBPortMode, DBPort, DBAuthMode, DBUserName, DBPassword, DBTimeout, InheritAmazonCredentials, AmazonAccessKey, AmazonSecretKey, InheritWindowsCompatibility, WmiDataSource, WmiTimeoutMethod, WmiTimeout, InheritSNMPCompatibility, SNMPDelay, SNMPRetryMode, SNMPOverflowMode, SNMPZeroValueMode, SNMPCounterMode, SNMPRequestMode, SNMPPortNameTemplate, SNMPPortNameUpdateMode, SNMPPortIdMode, SNMPInterfaceStartIndex, SNMPInterfaceEndIndex, InheritChannelUnit, BandwidthVolumeUnit, BandwidthSpeedUnit, BandwidthTimeUnit, MemoryUsageUnit, DiskSizeUnit, FileSizeUnit, InheritAccess, Name, Tags, Priority, DebugMode, Url, HttpRequestMethod, PostData, UseCustomPostContent, PostContentType, UseSNIFromUrl, InheritProxy, ProxyAddress, ProxyPort, ProxyUser, ProxyPassword, Timeout, PingPacketSize, PingMode, PingCount, PingDelay, AutoAcknowledge, InheritInterval, Interval, IntervalErrorMode, GraphType, ExeFile, ExeParameters, SetExeEnvironmentVariables, UseWindowsAuthentication, Mutex, WmiMode, Target, PingRemotePacketSize, ChannelDefinition, FactoryErrorMode, FactoryErrorFormula, FactoryMissingDataMode, StartStopped, NotifyChanged, MonitorPerformance, Database, UseCustomInstance, InstanceName, SqlEncryptionMode, SqlServerQuery, UseSqlInputParameter, SqlInputParameter, SqlTransactionMode, SqlProcessingMode, InheritTriggers, Comments, Host, Hostv4, Hostv6, ServiceUrl, AutoDiscoveryMode, AutoDiscoverySchedule" At line:1 char:67
If any further info is needed please let me know. Attached is the section in the GUI for the sensor. It's cut off slightly, but wanted to get all sections in the screenshot.
Thank you!