I can register host, uptime seems to be OK, everything went smooth - no problem there.
But, when i try to add service to this host i can't get the right data.
So, curl command is as follows:
Code: Select all
curl -XPOST "http://192.168.0.58/nagiosxi/api/v1/config/service?apikey=APIKEYGOESHERE&pretty=1" -d 'host_name=worker1&address=192.168.0.33&service_description=Memory Usage&check_interval=5&retry_interval=3&check_command=check_local_mem\!30\!20&check_interval=5&retry_interval=1&max_check_attempts=2&check_period=24x7&contacts=nagiosadmin¬ification_interval=5¬ification_period=24x7&applyconfig=1'
address: 192.168.0.33 - correct
nagiosxi address: 192.168.0.58 - corrent.
After i apply command i get:
Code: Select all
"success": "Added worker1 :: Memory Usage to the system. Config applied, Nagios Core was restarted."
Code: Select all
total used free shared buff/cache available
Mem: 1.9G 163M 984M
Code: Select all
Memory Usage Ok 7m 3s 1/2 2020-01-22 20:58:08 OK - 2876 / 3789 MB (75%) Free Memory, Used: 755 MB, Shared: 136 MB, Buffers + Cached: 711 MB
Code: Select all
Memory Usage Ok 42d 23h 44m 35s 1/4 2020-01-22 20:56:54 OK - 2890 / 3789 MB (76%) Free Memory, Used: 741 MB, Shared: 136 MB, Buffers + Cached: 711 MB
Under host management i can see:
Code: Select all
Host Name *
worker1
Alias
worker1
Address *
192.168.0.33
So, the questions are:
Is something wrong with curl command and/or why nagios reports itself data for another node?
Can't communicate with worker1 and that's why reports itself data?