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

[dev.icinga.com #10921] icingacli monitoring list --format=csv throws error #2230

Closed
icinga-migration opened this issue Jan 1, 2016 · 2 comments
Milestone

Comments

@icinga-migration
Copy link
Member

@icinga-migration icinga-migration commented Jan 1, 2016

This issue has been migrated from Redmine: https://dev.icinga.com/issues/10921

Created by kobmaki on 2016-01-01 11:34:39 +00:00

Assignee: (none)
Status: Resolved (closed on 2016-01-28 11:31:54 +00:00)
Target Version: 2.2.0
Last Update: 2016-01-28 11:31:54 +00:00 (in Redmine)


Bug show, Fatal error, "icingacli monitoring list --format=csv"

root@deb-icinga-test:~# icingacli  monitoring list --format=csv
PHP Fatal error:  Call to undefined method Icinga\Module\Monitoring\Backend\Ido\Query\ServicestatusQuery::getQuery() in /usr/share/php/Icinga/File/Csv.php on line 29

Fatal error: Call to undefined method Icinga\Module\Monitoring\Backend\Ido\Query\ServicestatusQuery::getQuery() in /usr/share/php/Icinga/File/Csv.php on line 29
root@deb-icinga-test:~# 

The local installation is up and running, "icingacli monitoring list"

root@deb-icinga-test:~# icingacli  monitoring list 

   UP    deb-icinga-test.koboldmaki: PING OK - Packet loss = 0%, RTA = 0.05 ms
   OK    ├─ icinga (For 32m 43s)
   OK    ├─ procs (For 32m 40s)
   OK    └─ swap (For 32m 33s)

root@deb-icinga-test:~# 

Reason for Fatal error, "icingacli monitoring list --format=csv"

In the file

/usr/share/php/Icinga/File/Csv.php

inside the funtion

public function __toString()

the bug comes from an unnecessary call of "getQuery"

      foreach ($this->query->getQuery()->fetchAll() as $row) {

Fix by remove "getQuery()"

It could be fixed by removing "getQuery()"

      foreach ($this->query->fetchAll() as $row) {

Affected packages

root@deb-icinga-test:~# dpkg -l php-icinga
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                        Version            Architecture       Description
+++-===========================-==================-==================-===========================================================
ii  php-icinga                  2.1.2+snapshot2015 all                PHP library to communicate with and use Icinga
root@deb-icinga-test:~# 

and on github

https://github.com/Icinga/icingaweb2/blob/master/library/Icinga/File/Csv.php

After fix is apply, " icingacli monitoring list --format=csv"

root@deb-icinga-test:~# icingacli monitoring list --format=csv
host_name,host_state,host_output,host_handled,host_acknowledged,host_in_downtime,service_description,service_state,service_acknowledged,service_in_downtime,service_handled,service_output,service_perfdata,service_last_state_change
"deb-icinga-test.koboldmaki","0","PING OK - Packet loss = 0%, RTA = 0.05 ms","0","0","0","icinga","0","0","0","0","Icinga 2 has been running for 1 hour and 11 minutes. Version: v2.4.1-90-g95e62df","active_host_checks=0.016666666666666666 passive_host_checks=0 active_host_checks_1min=1 passive_host_checks_1min=0 active_host_checks_5min=6 passive_host_checks_5min=0 active_host_checks_15min=15 passive_host_checks_15min=0 active_service_checks=0.20000000000000001 passive_service_checks=0 active_service_checks_1min=12 passive_service_checks_1min=0 active_service_checks_5min=60 passive_service_checks_5min=0 active_service_checks_15min=180 passive_service_checks_15min=0 min_latency=0 max_latency=0 avg_latency=0 min_execution_time=0 max_execution_time=0 avg_execution_time=0.71302713950475061 num_services_ok=12 num_services_warning=0 num_services_critical=0 num_services_unknown=0 num_services_pending=0 num_services_unreachable=0 num_services_flapping=0 num_services_in_downtime=0 num_services_acknowledged=0 uptime=4260.5039041042328 num_hosts_up=1 num_hosts_down=0 num_hosts_pending=0 num_hosts_unreachable=0 num_hosts_flapping=0 num_hosts_in_downtime=0 num_hosts_acknowledged=0","1451647104"
"deb-icinga-test.koboldmaki","0","PING OK - Packet loss = 0%, RTA = 0.05 ms","0","0","0","procs","0","0","0","0","PROCS OK: 114 processes ","procs=114;250;400;0;","1451647107"
"deb-icinga-test.koboldmaki","0","PING OK - Packet loss = 0%, RTA = 0.05 ms","0","0","0","swap","0","0","0","0","SWAP OK - 100% free (707 MB out of 707 MB) ","swap=707MB;353;176;0;707","1451647114"
root@deb-icinga-test:~# 

Changesets

2016-01-27 08:09:52 +00:00 by kobmaki 9f79f9a

monitoring/CLI: Fix error on CSV output

Signed-off-by: Eric Lippmann <eric.lippmann@netways.de>

fixes #10921
@icinga-migration

This comment has been minimized.

Copy link
Member Author

@icinga-migration icinga-migration commented Jan 5, 2016

Updated by elippmann on 2016-01-05 08:31:37 +00:00

  • Subject changed from broken-command-icingacli-monitoring-list--format-csv to icingacli monitoring list --format=csv throws error
  • Target Version set to 2.2.0
@icinga-migration

This comment has been minimized.

Copy link
Member Author

@icinga-migration icinga-migration commented Jan 28, 2016

Updated by kobmaki on 2016-01-28 11:31:54 +00:00

  • Status changed from New to Resolved
  • Done % changed from 0 to 100

Applied in changeset 9f79f9a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.