Thruk icon indicating copy to clipboard operation
Thruk copied to clipboard

Business Process "No such host"

Open twisterrm opened this issue 3 years ago • 6 comments

Hi all, I have a problem with business process plugin. I have several business process based only on host (not services), my host name has a "normal name" (no symbols or other) but my display name has several [] inside the name i.e. [DEV][A1]Webserver, could be this the issue? There's a workaround for that? (I cannot change host description) Thanks in advance

twisterrm avatar Jun 09 '21 11:06 twisterrm

where do you get the error? Could you explain a bit more in detail what's going wrong.

sni avatar Jun 21 '21 15:06 sni

Thanks for the reply, As you can see in the pics,I created a new "test" business process, added one host, the bp report host not found, but if i click on the little arrow on the low right corner i can reach the host correctly, I suppose that the issue is related to my naming convention ([PREPRD]...), the issue is present with every host and/or services, i have read that for the services is possible to use regex (I tried but no luck, surely my bad) but with hosts? Schermata del 2021-06-23 09-12-26 Schermata del 2021-06-23 09-14-42 Schermata del 2021-06-23 09-15-07 Schermata del 2021-06-23 09-15-34

twisterrm avatar Jun 23 '21 07:06 twisterrm

[PREPROD][S4] GRAY-APP-1 is the hostname, right? Could you show the relevant parts of the host configuration, like host_name, alias and displayname (if used). Please also attach the example business process. So far i am unable to reproduce the issue.

sni avatar Jun 30 '21 12:06 sni

Hi Sni!

define host{
        use                      linux-severity-4
        host_name                GRAY-APP-1
        alias                    GRAY-APP-1
        display_name             [PREPRD][S4] GRAY-APP-1
        address                  xx.xxx.xxx.xxx
}
{
   "create_host_object" : 1,
   "filter" : [],
   "name" : "New Business Process 2",
   "nodes" : [
      {
         "contactgroups" : [],
         "contacts" : [],
         "create_obj" : 1,
         "depends" : [
            "node2"
         ],
         "filter" : [],
         "function" : "worst",
         "function_args" : [],
         "id" : "node1",
         "label" : "New Business Process 2"
      },
      {
         "contactgroups" : [],
         "contacts" : [],
         "depends" : [],
         "filter" : [],
         "function" : "status",
         "function_args" : [
            "GRAY-APP-1",
            "",
            "="
         ],
         "id" : "node2",
         "label" : "Example Node"
      }
   ],
   "rankDir" : "TB",
   "state_type" : "both",
   "template" : ""
}

Thank you again for your time

twisterrm avatar Jun 30 '21 12:06 twisterrm

i am still unable to reproduce this some way. Added a host with you config and copied the bp but it works like expected.

sni avatar Oct 01 '21 13:10 sni

Hi Sven,

The same thing is happening to me when creating a business process. I don't believe the host and its services. I share the log.

[14:43:46,405][E][...b/Thruk/Utils/CLI/Bp.pm:213] bp 'MELI_prueba' failed: 400: Failed validation of host_name as type host (argument 0) at /usr/share/thruk/lib/Monitoring/Livestatus.pm line 1573, <GEN4> line 1. [14:43:46,406][E][...b/Thruk/Utils/CLI/Bp.pm:213] Monitoring::Livestatus::_die_or_confess("400: Failed validation of host_name as type host (argument 0)") called at /usr/share/thruk/lib/Monitoring/Livestatus.pm line 1135 [14:43:46,406][E][...b/Thruk/Utils/CLI/Bp.pm:213] Monitoring::Livestatus::_send_socket(Monitoring::Livestatus=HASH(0x55e7f8b64328), "COMMAND [1710956626] PROCESS_HOST_CHECK_RESULT;MELI_prueba;0;OK - business process calculation of 2 nodes complete in 0.000s|runtime=0.000s\x{a}Backends: 1cca8\x{a}\x{a}COMMAND [1710956626] PROCESS_SERVICE_CHECK_RESULT;MELI_prueba;MELI_prueba;0;OK - everything is fine\x{a}Backends: 1cca8\x{a}") called at /usr/share/thruk/lib/Monitoring/Livestatus.pm line 823 [14:43:46,406][E][...b/Thruk/Utils/CLI/Bp.pm:213] Monitoring::Livestatus::_send(Monitoring::Livestatus=HASH(0x55e7f8b64328), "COMMAND [1710956626] PROCESS_HOST_CHECK_RESULT;MELI_prueba;0;OK - business process calculation of 2 nodes complete in 0.000s|runtime=0.000s\x{a}Backends: 1cca8\x{a}\x{a}COMMAND [1710956626] PROCESS_SERVICE_CHECK_RESULT;MELI_prueba;MELI_prueba;0;OK - everything is fine\x{a}Backends: 1cca8", HASH(0x55e7f87d3860)) called at /usr/share/thruk/lib/Monitoring/Livestatus.pm line 248 [14:43:46,406][E][...b/Thruk/Utils/CLI/Bp.pm:213] Monitoring::Livestatus::do(Monitoring::Livestatus=HASH(0x55e7f8b64328), "COMMAND [1710956626] PROCESS_HOST_CHECK_RESULT;MELI_prueba;0;OK - business process calculation of 2 nodes complete in 0.000s|runtime=0.000s\x{a}Backends: 1cca8\x{a}\x{a}COMMAND [1710956626] PROCESS_SERVICE_CHECK_RESULT;MELI_prueba;MELI_prueba;0;OK - everything is fine\x{a}Backends: 1cca8", HASH(0x55e7f87d3860)) called at /usr/share/thruk/lib/Thruk/Backend/Provider/Livestatus.pm line 258 [14:43:46,407][E][...b/Thruk/Utils/CLI/Bp.pm:213] Thruk::Backend::Provider::Livestatus::send_command(Thruk::Backend::Provider::Livestatus=HASH(0x55e7f8b63e60), "command", "COMMAND [1710956626] PROCESS_HOST_CHECK_RESULT;MELI_prueba;0;OK - business process calculation of 2 nodes complete in 0.000s|runtime=0.000s\x{a}\x{a}COMMAND [1710956626] PROCESS_SERVICE_CHECK_RESULT;MELI_prueba;MELI_prueba;0;OK - everything is fine", "backend", ARRAY(0x55e7f9537820)) called at /usr/share/thruk/lib/Thruk/Backend/Manager.pm line 1885 [14:43:46,407][E][...b/Thruk/Utils/CLI/Bp.pm:213] Thruk::Backend::Manager::_get_result_lmd(Thruk::Backend::Manager=HASH(0x55e7f91d9c38), ARRAY(0x55e7f95378e0), "send_command", ARRAY(0x55e7f91b82b8)) called at /usr/share/thruk/lib/Thruk/Backend/Manager.pm line 1955 [14:43:46,407][E][...b/Thruk/Utils/CLI/Bp.pm:213] eval {...} called at /usr/share/thruk/lib/Thruk/Backend/Manager.pm line 1954 [14:43:46,407][E][...b/Thruk/Utils/CLI/Bp.pm:213] Thruk::Backend::Manager::_get_result_lmd_with_retries(Thruk::Backend::Manager=HASH(0x55e7f91d9c38), Thruk::Context=HASH(0x55e7f90a5f28), ARRAY(0x55e7f95378e0), "send_command", ARRAY(0x55e7f91b82b8), 1) called at /usr/share/thruk/lib/Thruk/Backend/Manager.pm line 1573 [14:43:46,408][E][...b/Thruk/Utils/CLI/Bp.pm:213] Thruk::Backend::Manager::_do_on_peers(Thruk::Backend::Manager=HASH(0x55e7f91d9c38), "send_command", ARRAY(0x55e7f91b82b8)) called at /usr/share/thruk/lib/Thruk/Backend/Manager.pm line 2167 [14:43:46,408][E][...b/Thruk/Utils/CLI/Bp.pm:213] Thruk::Backend::Manager::AUTOLOAD(Thruk::Backend::Manager=HASH(0x55e7f91d9c38), "backend", ARRAY(0x55e7f9537820), "command", "COMMAND [1710956626] PROCESS_HOST_CHECK_RESULT;MELI_prueba;0;OK - business process calculation of 2 nodes complete in 0.000s|runtime=0.000s\x{a}\x{a}COMMAND [1710956626] PROCESS_SERVICE_CHECK_RESULT;MELI_prueba;MELI_prueba;0;OK - everything is fine") called at /etc/thruk/plugins//plugins-enabled/business_process/lib/Thruk/BP/Components/BP.pm line 885 [14:43:46,408][E][...b/Thruk/Utils/CLI/Bp.pm:213] Thruk::BP::Components::BP::_submit_results_to_core_backend(Thruk::BP::Components::BP=HASH(0x55e7f93dc1a8), Thruk::Context=HASH(0x55e7f90a5f28), ARRAY(0x55e7f95372f8)) called at /etc/thruk/plugins//plugins-enabled/business_process/lib/Thruk/BP/Components/BP.pm line 849 [14:43:46,408][E][...b/Thruk/Utils/CLI/Bp.pm:213] Thruk::BP::Components::BP::_submit_results_to_core(Thruk::BP::Components::BP=HASH(0x55e7f93dc1a8), Thruk::Context=HASH(0x55e7f90a5f28), ARRAY(0x55e7f95372f8)) called at /etc/thruk/plugins//plugins-enabled/business_process/lib/Thruk/BP/Components/BP.pm line 258 [14:43:46,408][E][...b/Thruk/Utils/CLI/Bp.pm:213] Thruk::BP::Components::BP::update_status(Thruk::BP::Components::BP=HASH(0x55e7f93dc1a8), Thruk::Context=HASH(0x55e7f90a5f28)) called at /etc/thruk/plugins//plugins-enabled/business_process/lib/Thruk/Utils/CLI/Bp.pm line 210 [14:43:46,409][E][...b/Thruk/Utils/CLI/Bp.pm:213] eval {...} called at /etc/thruk/plugins//plugins-enabled/business_process/lib/Thruk/Utils/CLI/Bp.pm line 209 [14:43:46,409][E][...b/Thruk/Utils/CLI/Bp.pm:213] Thruk::Utils::CLI::Bp::ANON(1) called at /usr/share/thruk/lib/Thruk/Utils.pm line 3730 [14:43:46,409][E][...b/Thruk/Utils/CLI/Bp.pm:213] Thruk::Utils::scale_out("scale", 1, "jobs", ARRAY(0x55e7f91f8870), "worker", CODE(0x55e7f94ccd30), "collect", CODE(0x55e7f9533978)) called at /etc/thruk/plugins//plugins-enabled/business_process/lib/Thruk/Utils/CLI/Bp.pm line 231 [14:43:46,409][E][...b/Thruk/Utils/CLI/Bp.pm:213] Thruk::Utils::CLI::Bp::cmd(Thruk::Context=HASH(0x55e7f90a5f28), "bp", ARRAY(0x55e7f90a5e50), HASH(0x55e7f6b240f8), "local", HASH(0x55e7f6b24188)) called at /usr/share/thruk/lib/Thruk/Utils/CLI.pm line 765 [14:43:46,410][E][...b/Thruk/Utils/CLI/Bp.pm:213] Thruk::Utils::CLI::_run_command_action(Thruk::Context=HASH(0x55e7f90a5f28), HASH(0x55e7f6b24188), "local", "bp") called at /usr/share/thruk/lib/Thruk/Utils/CLI.pm line 629 [14:43:46,410][E][...b/Thruk/Utils/CLI/Bp.pm:213] Thruk::Utils::CLI::_run_commands(Thruk::Context=HASH(0x55e7f90a5f28), HASH(0x55e7f6b24188), "local") called at /usr/share/thruk/lib/Thruk/Utils/CLI.pm line 521 [14:43:46,410][E][...b/Thruk/Utils/CLI/Bp.pm:213] eval {...} called at /usr/share/thruk/lib/Thruk/Utils/CLI.pm line 520 [14:43:46,410][E][...b/Thruk/Utils/CLI/Bp.pm:213] Thruk::Utils::CLI::from_local(Thruk::Utils::CLI=HASH(0x55e7f6b241a0), Thruk::Context=HASH(0x55e7f90a5f28), HASH(0x55e7f6b24188)) called at /usr/share/thruk/lib/Thruk/Utils/CLI.pm line 348 [14:43:46,411][E][...b/Thruk/Utils/CLI/Bp.pm:213] Thruk::Utils::CLI::_run_do(Thruk::Utils::CLI=HASH(0x55e7f6b241a0)) called at /usr/share/thruk/lib/Thruk/Utils/CLI.pm line 307 [14:43:46,411][E][...b/Thruk/Utils/CLI/Bp.pm:213] eval {...} called at /usr/share/thruk/lib/Thruk/Utils/CLI.pm line 306 [14:43:46,411][E][...b/Thruk/Utils/CLI/Bp.pm:213] Thruk::Utils::CLI::_run(Thruk::Utils::CLI=HASH(0x55e7f6b241a0)) called at /bin/thruk line 134 [14:43:46,411][D][...b/Thruk/Utils/CLI/Bp.pm:222] 1/1 bp update failed in 0.029s | 1.tbp | 'MELI_prueba' [14:43:46,413][D][.../lib/Thruk/Utils/CLI.pm:354] _run(): building local response done (exitcode: 0, duration: 0.081s) [14:43:46,414][D][.../lib/Thruk/Utils/CLI.pm:357] +----------------------------------------------------------------------------------+-------------+ [14:43:46,415][D][.../lib/Thruk/Utils/CLI.pm:357] | total time | 0.08298s | [14:43:46,415][D][.../lib/Thruk/Utils/CLI.pm:357] +----------------------------------------------------------------------------------+-------------+ [14:43:46,415][D][.../lib/Thruk/Utils/CLI.pm:357] | _dispatcher: http://localhost/thruk/cgi-bin/remote.cgi | 0.00358s | [14:43:46,415][D][.../lib/Thruk/Utils/CLI.pm:357] | time: Wed Mar 20 14:43:46 2024 - host: nagios-lab - pid: 54352 - req: 1 | | [14:43:46,415][D][.../lib/Thruk/Utils/CLI.pm:357] | Root begin | 0.00178s | [14:43:46,415][D][.../lib/Thruk/Utils/CLI.pm:357] | Thruk::Controller::remote::index | 0.00019s | [14:43:46,416][D][.../lib/Thruk/Utils/CLI.pm:357] | finalize_request | 0.00002s | [14:43:46,416][D][.../lib/Thruk/Utils/CLI.pm:357] | User::set_dynamic_attributes | 0.00002s | [14:43:46,416][D][.../lib/Thruk/Utils/CLI.pm:357] | _run_command_action() | 0.07936s | [14:43:46,416][D][.../lib/Thruk/Utils/CLI.pm:357] | AddDefaults::add_defaults(CACHED_DEFAULT) | 0.00981s | [14:43:46,416][D][.../lib/Thruk/Utils/CLI.pm:357] | AddDefaults::set_processinfo(SAFE_DEFAULT) | 0.00669s | [14:43:46,417][D][.../lib/Thruk/Utils/CLI.pm:357] | AddDefaults::set_processinfo fetch | 0.00653s | [14:43:46,417][D][.../lib/Thruk/Utils/CLI.pm:357] | _do_on_peers(get_processinfo) | 0.00340s | [14:43:46,417][D][.../lib/Thruk/Utils/CLI.pm:357] | _get_result_lmd(get_processinfo) | 0.00299s | [14:43:46,417][D][.../lib/Thruk/Utils/CLI.pm:357] | _do_on_peers(get_sites) | 0.00225s | [14:43:46,417][D][.../lib/Thruk/Utils/CLI.pm:357] | _get_result_lmd(get_sites) | 0.00191s | [14:43:46,417][D][.../lib/Thruk/Utils/CLI.pm:357] | AddDefaults::get_proc_info | 0.00010s | [14:43:46,418][D][.../lib/Thruk/Utils/CLI.pm:357] | User::set_dynamic_attributes | 0.00001s | [14:43:46,418][D][.../lib/Thruk/Utils/CLI.pm:357] | Utils::Menu::read_navigation() | 0.00163s | [14:43:46,418][D][.../lib/Thruk/Utils/CLI.pm:357] | _cmd_bp(bp) | 0.06676s | [14:43:46,418][D][.../lib/Thruk/Utils/CLI.pm:357] | _do_on_peers(get_hosts) | 0.00256s | [14:43:46,418][D][.../lib/Thruk/Utils/CLI.pm:357] | _get_result_lmd(get_hosts) | 0.00219s | [14:43:46,418][D][.../lib/Thruk/Utils/CLI.pm:357] | update_status | ~0.03087s | [14:43:46,419][D][.../lib/Thruk/Utils/CLI.pm:357] | _do_on_peers(get_hosts) | 0.00270s | [14:43:46,419][D][.../lib/Thruk/Utils/CLI.pm:357] | _get_result_lmd(get_hosts) | 0.00235s | [14:43:46,419][D][.../lib/Thruk/Utils/CLI.pm:357] | update_status bp-1-node1 | 0.00012s | [14:43:46,419][D][.../lib/Thruk/Utils/CLI.pm:357] | update_status bp-1-node2 | 0.00004s | [14:43:46,419][D][.../lib/Thruk/Utils/CLI.pm:357] | update_status bp-1-node1 | 0.00010s | [14:43:46,420][D][.../lib/Thruk/Utils/CLI.pm:357] | _submit_results_to_core | ~0.02776s | [14:43:46,420][D][.../lib/Thruk/Utils/CLI.pm:357] | _do_on_peers(send_command) | ~0.02761s | [14:43:46,420][D][.../lib/Thruk/Utils/CLI.pm:357] | _get_result_lmd(send_command) | ~0.02731s | [14:43:46,420][D][.../lib/Thruk/Utils/CLI.pm:357] +----------------------------------------------------------------------------------+-------------+ [14:43:46,420][D][.../lib/Thruk/Utils/CLI.pm:357] | total time waited on backends | 0.00000s | [14:43:46,420][D][.../lib/Thruk/Utils/CLI.pm:357] | total time waited on rendering | 0.00000s | [14:43:46,421][D][.../lib/Thruk/Utils/CLI.pm:357] | total time | 0.08298s | [14:43:46,421][D][.../lib/Thruk/Utils/CLI.pm:357] +--------------------------------------------------- -------------------------------+-------------+ [14:43:46,421][I][.../lib/Thruk/Utils/CLI.pm:372] OK - 1 business processes updated in 0.03s (30.7/s)

gvincenti avatar Mar 20 '24 19:03 gvincenti