You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @wasserja. I found your Nagios module and did some experimenting. However, I found that the functions didn't work the way that I expected.
I started out by setting the values of my Nagios server in the parameters NagiosXiApiUrl and NagiosXiApiKey in MrANagios.psm1. Then I tried several functions.
Example: Get-NagiosXiServiceStatus
When using the command Get-NagiosXiServiceStatus -HostName 'hostname01' no output is written to the console. When using the -verbose switch, I see that the communication with the Nagios server takes place, as can be seen in the following output:
In my situation, the object $ServiceStatus.servicestatuslist.servicestatus returns nothing, because $ServiceStatus doesn't have a property called servicestatuslist. However, it does contain a property servicestatus . I changed the code to the code below, which fixed the problem for me.
Is there something that I am missing, or is there simply an error in the code? By the way, I have noticed similar problems with the other Get-NagiosXi functions.
As a side note: are you open for contributions? I'm happy to make modifications and would like to introduce some functions for additional Nagios functionality.
Thanks!
The text was updated successfully, but these errors were encountered:
Thank you for the feedback. It has been two years since I've worked with Nagios XI during which time I suspect the API may have changed (or my code never worked?). Please do help fix it if it is worth it to you.
Hi @wasserja. I found your Nagios module and did some experimenting. However, I found that the functions didn't work the way that I expected.
I started out by setting the values of my Nagios server in the parameters NagiosXiApiUrl and NagiosXiApiKey in
MrANagios.psm1
. Then I tried several functions.Example: Get-NagiosXiServiceStatus
When using the command
Get-NagiosXiServiceStatus -HostName 'hostname01'
no output is written to the console. When using the-verbose
switch, I see that the communication with the Nagios server takes place, as can be seen in the following output:I was looking in function and saw the following code:
MrANagios/Get-NagiosXiServiceStatus.ps1
Lines 112 to 117 in b60ac0c
In my situation, the object $ServiceStatus.servicestatuslist.servicestatus returns nothing, because $ServiceStatus doesn't have a property called
servicestatuslist
. However, it does contain a propertyservicestatus
. I changed the code to the code below, which fixed the problem for me.Is there something that I am missing, or is there simply an error in the code? By the way, I have noticed similar problems with the other Get-NagiosXi functions.
As a side note: are you open for contributions? I'm happy to make modifications and would like to introduce some functions for additional Nagios functionality.
Thanks!
The text was updated successfully, but these errors were encountered: