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

Correctly handle keepalive option #78

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vaxvms
Copy link
Member

@vaxvms vaxvms commented May 16, 2018

mod-livestatus doesn't close the connection when keepalive isn't set.

It break clients who wait for server to close the connection after sending data such as https://github.com/sni/lmd as describe in sni/lmd#24

@olivierHa
Copy link
Member

Hello,

J'ai l'impression que tu coupes le Keepalive pour toutes les requetes sauf celles de type "wait".

Je me trompe ?

@vaxvms
Copy link
Member Author

vaxvms commented May 18, 2018

Non, je conserve le keepalive pour les requetes qui le demande explicitement.

le keepalive etait parfois un boolean, parfois une chaine. J'ai tout mis en chaine

13:40 $ telnet localhost 50000
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET status
KeepAlive: on

accept_passive_host_checks;accept_passive_service_checks;cached_log_messages;cached_log_messages_rate;check_external_commands;check_host_freshness;check_service_freshness;connections;connections_rate;enable_event_handlers;enable_flap_detection;enable_notifications;execute_host_checks;execute_service_checks;external_command_buffer_max;external_command_buffer_slots;external_command_buffer_usage;external_commands_rate;forks;forks_rate;host_checks;host_checks_rate;interval_length;last_command_check;last_log_rotation;livestatus_version;log_messages;log_messages_rate;nagios_pid;neb_callbacks;neb_callbacks_rate;obsess_over_hosts;obsess_over_services;process_performance_data;program_start;program_version;requests;requests_rate;service_checks;service_checks_rate
1;1;0;0;1;1;1;0;0;1;1;1;1;1;0;0;0;0;0;0;0;0;60;1526643647;1526643647;2.0-shinken;0;0;54841;0;0;0;0;1;1526455533;2.4.3;0;0;0;0
GET status

accept_passive_host_checks;accept_passive_service_checks;cached_log_messages;cached_log_messages_rate;check_external_commands;check_host_freshness;check_service_freshness;connections;connections_rate;enable_event_handlers;enable_flap_detection;enable_notifications;execute_host_checks;execute_service_checks;external_command_buffer_max;external_command_buffer_slots;external_command_buffer_usage;external_commands_rate;forks;forks_rate;host_checks;host_checks_rate;interval_length;last_command_check;last_log_rotation;livestatus_version;log_messages;log_messages_rate;nagios_pid;neb_callbacks;neb_callbacks_rate;obsess_over_hosts;obsess_over_services;process_performance_data;program_start;program_version;requests;requests_rate;service_checks;service_checks_rate
1;1;0;0;1;1;1;0;0;1;1;1;1;1;0;0;0;0;0;0;0;0;60;1526643647;1526643647;2.0-shinken;0;0;54841;0;0;0;0;1;1526455533;2.4.3;0;0;0;0
Connection closed by foreign host.

https://mathias-kettner.de/checkmk_livestatus.html#Sending%20commands%20via%20Livestatus
"""
COMMAND automatically implies keep alive and behave like GET when KeepAlive is set to on.
That way you can mix GET and COMMAND quries in one connection.
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants