Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency with check_ncpa.py and check_ping using IPv6 #1181

Open
vtracnagios opened this issue Jun 28, 2024 · 0 comments
Open

Inconsistency with check_ncpa.py and check_ping using IPv6 #1181

vtracnagios opened this issue Jun 28, 2024 · 0 comments

Comments

@vtracnagios
Copy link

Example "check_ncpa.py"
nagios@nagioserver:/usr/local/nagios/libexec$ ./check_ncpa.py -H 1111:2222:3333:4444:5555::20 -t 'ebpDZeURGJJUDiqE' -P 5693 -M 'disk/logical/C:|' -w '70' -c '90'
UNKNOWN: An error occurred connecting to API. (HTTP error: '500 INTERNAL SERVER ERROR')

nagios@nagioserver:/usr/local/nagios/libexec$ ./check_ncpa.py -H [1111:2222:3333:4444:5555::20] -t 'ebpDZeURGJJUDiqE' -P 5693 -M 'disk/logical/C:|' -w '70' -c '90'
OK: Used disk space was 20.40 % (Used: 25.75 GiB, Free: 100.57 GiB, Total: 126.32 GiB) | 'used'=25.75GiB;;; 'free'=100.57GiB;;; 'total'=126.32GiB;;;

Example "check_ping"
nagios@nagioserver:/usr/local/nagios/libexec$ ./check_ping -H [1111:2222:3333:4444:5555::20] -w 3000.0,80% -c 5000.0,100% -p 5
check_ping: Invalid hostname/address - [1111:2222:3333:4444:5555::20]
Usage:
check_ping -H <host_address> -w ,% -c ,%
[-p packets] [-t timeout] [-4|-6]

nagios@nagioserver:/usr/local/nagios/libexec$ ./check_ping -H 1111:2222:3333:4444:5555::20 -w 3000.0,80% -c 5000.0,100% -p 5
PING OK - Packet loss = 0%, RTA = 40.96 ms|rta=40.955002ms;3000.000000;5000.000000;0.000000 pl=0%;80;100;0

A client experimenting with editing check_ncpa.py Line 173-176

api_address = '[https://%s:%d/api](https://%25s:%d/api)' % (hostname, port)
else:
api_address = '[https://%s:%d/api/%s/%s](https://%25s:%d/api/%s/%s)' % (hostname, port, metric, arguments)

Changing to

api_address = 'https://[%s]:%d/api' % (hostname, port)
else:
api_address = 'https://[%s]:%d/api/%s/%s' % (hostname, port, metric, arguments)

Ticket:
https://nagiosenterprises.lightning.force.com/lightning/r/Case/500Vm00000AB072IAD/view

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants