lizell / php-nagios-json Goto Github PK
View Code? Open in Web Editor NEWScript to parse Nagios status.dat and present it as JSON, to allow inclusion of status info in a web page served from a separate machine.
Script to parse Nagios status.dat and present it as JSON, to allow inclusion of status info in a web page served from a separate machine.
Version c8f6318 of the script now renders an empty version of the statuses. See attached screenshot.
Hi,
The script is very useful, but, when I have services in separate hosts with the same service name, I see only one the last in the resulting JSON. For instance, if I have a service called service1
in host1
and a service1
in host2
the script returns only the second service1
.
Wouldn't it be better if the service keys on the JSON were composed of the host name and service description?
Thanks in advanced.
I'm looking to see if it's possible to add hostcomment
and servicecomment
to the PHP JSON file?
I've been tinkering on this for a few hours now, and keep hitting my head against the wall.
I'm hopeful you have an easy solution
Hi,
when trying to use this I only get a white page back. While debugging the script I noticed that getData3 returns this array:
Array
(
[modified_host_attributes] => 1
[modified_service_attributes] => 1
[nagios_pid] => 15789
[daemon_mode] => 1
[program_start] => 1402561589
[last_command_check] => 1402565505
[last_log_rotation] => 0
[enable_notifications] => 1
[active_service_checks_enabled] => 1
[passive_service_checks_enabled] => 1
[active_host_checks_enabled] => 1
[passive_host_checks_enabled] => 1
[enable_event_handlers] => 1
[obsess_over_services] => 0
[obsess_over_hosts] => 0
[check_service_freshness] => 1
[check_host_freshness] => 0
[enable_flap_detection] => 1
[enable_failure_prediction] => 1
[process_performance_data] => 0
[global_host_event_handler] =>
[global_service_event_handler] =>
[next_comment_id] => 487346
[next_downtime_id] => 51129
[next_event_id] => 4922987
[next_problem_id] => 2364885
[next_notification_id] => 1360359
[total_external_command_buffer_slots] => 4096
[used_external_command_buffer_slots] => 0
[high_external_command_buffer_slots] => 879
[active_scheduled_host_check_stats] => 34,375,1133
[active_ondemand_host_check_stats] => 5,16,51
[passive_host_check_stats] => 0,0,0
[active_scheduled_service_check_stats] => 748,5150,15668
[active_ondemand_service_check_stats] => 0,0,0
[passive_service_check_stats] => 18,810,2248
[cached_host_check_stats] => 3,11,38
[cached_service_check_stats] => 0,0,0
[external_command_stats] => 19,816,2264
[parallel_host_check_stats] => 36,381,1146
[serial_host_check_stats] => 0,0,0
)
I suspect that it should contain all services and hosts.
More info: I use the latest version of the script and nagios 3
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.