Pulling Details of Servers details from Nagios database
Pulling Details of Servers details from Nagios database
Hello Experts,
Can someone help to get the details (SQL Query) of Servers from nagios DB? Would like to see what all parameters can be pulled out from it?
Thanks,
Rajesh
Can someone help to get the details (SQL Query) of Servers from nagios DB? Would like to see what all parameters can be pulled out from it?
Thanks,
Rajesh
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Pulling Details of Servers details from Nagios database
We have an API built-in to Nagios XI for retrieving data, documentation can be found in the software
Help -> API Docs
Help -> API Docs
Re: Pulling Details of Servers details from Nagios database
Unfortunately I dont have environment setup. Can you please share me the code of API here or the Steps please?
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Pulling Details of Servers details from Nagios database
There are over 50 API endpoints with different data in them, I cannot have all of them here, they are documented in the software
Re: Pulling Details of Servers details from Nagios database
Thank you, I was looking to know what all details can Nagios gives us. ( Example: Server hostname, IP, location, etc, ) ALL .
Anyways thank you
Anyways thank you
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Pulling Details of Servers details from Nagios database
It basically can only give you what you put in, and then the results of the check commands when they run.Raj_Esh wrote:Thank you, I was looking to know what all details can Nagios gives us. ( Example: Server hostname, IP, location, etc, ) ALL .
Anyways thank you
Re: Pulling Details of Servers details from Nagios database
Thanks Scott
I dont have any Nagios installed now so was checking if i get the fields on what all I get to have Demo ( Saying Nagios will have all this details)
So was looking for example field names as mentioned in last post
I dont have any Nagios installed now so was checking if i get the fields on what all I get to have Demo ( Saying Nagios will have all this details)
So was looking for example field names as mentioned in last post
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Pulling Details of Servers details from Nagios database
This is what the results of just one of the 50+ API's look like. You can setup a trial and look at all available options
Code: Select all
{
"recordcount": "12",
"hoststatus": [
{
"@attributes": {
"id": "401"
},
"instance_id": "1",
"host_id": "202",
"name": "tset",
"display_name": "tset",
"address": "127.0.53.53",
"alias": "tset",
"status_update_time": "2015-09-24 02:05:51",
"status_text": "OK - 127.0.53.53: rta 0.021ms, lost 0%",
"status_text_long": "",
"current_state": "0",
"icon_image": "server.png",
"icon_image_alt": "",
"performance_data": "rta=0.021ms;3000.000;5000.000;0; pl=0%;80;100;; rtmax=0.060ms;;;; rtmin=0.011ms;;;;",
"should_be_scheduled": "1",
"check_type": "0",
"last_state_change": "2015-09-22 12:11:41",
"last_hard_state_change": "2015-09-22 12:11:41",
"last_hard_state": "0",
"last_time_up": "2015-09-24 02:05:51",
"last_time_down": "1969-12-31 18:00:00",
"last_time_unreachable": "1969-12-31 18:00:00",
"last_notification": "1969-12-31 18:00:00",
"next_notification": "1969-12-31 18:00:00",
"no_more_notifications": "0",
"acknowledgement_type": "0",
"current_notification_number": "0",
"event_handler_enabled": "1",
"process_performance_data": "1",
"obsess_over_host": "1",
"modified_host_attributes": "0",
"event_handler": "",
"check_command": "check_xi_host_ping!3000.0!80%!5000.0!100%",
"normal_check_interval": "40",
"retry_check_interval": "5",
"check_timeperiod_id": "128",
"has_been_checked": "1",
"current_check_attempt": "1",
"max_check_attempts": "4",
"last_check": "2015-09-24 02:05:51",
"next_check": "2015-09-24 02:45:51",
"state_type": "1",
"notifications_enabled": "0",
"problem_acknowledged": "0",
"passive_checks_enabled": "1",
"active_checks_enabled": "1",
"flap_detection_enabled": "1",
"is_flapping": "0",
"percent_state_change": "0",
"latency": "0",
"execution_time": "0.00226",
"scheduled_downtime_depth": "0"
}
]
}
Re: Pulling Details of Servers details from Nagios database
Awesome..
This is what I was looking for Thanks, much Appreciated
And sure, I will definitely try other API's as well.
This is what I was looking for Thanks, much Appreciated
And sure, I will definitely try other API's as well.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Pulling Details of Servers details from Nagios database
Sounds goodRaj_Esh wrote:Awesome..
This is what I was looking for Thanks, much Appreciated
And sure, I will definitely try other API's as well.
Locking thread