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 #3446] Add troubleshooting collect cli command #404

Closed
icinga-migration opened this issue Nov 19, 2012 · 49 comments
Closed
Labels
area/cli Command line helpers enhancement New feature or request
Milestone

Comments

@icinga-migration
Copy link

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

Created by dgoetz on 2012-11-19 14:21:46 +00:00

Assignee: jflach
Status: Closed (closed on 2015-03-02 15:54:24 +00:00)
Target Version: 2.3.0
Last Update: 2016-03-31 10:43:17 +00:00 (in Redmine)

Backport?: No
Include in Changelog: 1

For support and bug tickets I think it would be helpful to have a tool that collects logfiles, the configuration and some systemdetails (kernel, distribution, mysql-version) in one tar. Advantage will be that bugs are easily reproduce- and analyzable.

Perhaps the tool would need an anonymize flag in later versions that changes hostnames and ipaddress or can exclude macros containing passwords for paranoid users.

Changesets

2015-01-22 11:10:32 +00:00 by jflach 90c4517

Add CLI command to collect logs

Currently only works for windows!
By calling `icinga2 troubleshoot collect [--console]` a small file
containing basic application information and a tail of all found logs
and the latest crash report will be created [or displayed].
It does not collect config files at the moment.

refs #3446

2015-01-23 10:28:54 +00:00 by jflach ce69c2b

Add CLI command to collect logs

Currently only works for windows!
By calling `icinga2 troubleshoot collect [--console]` a small file
containing basic application information and a tail of all found logs
and the latest crash report will be created [or displayed].
It does not collect config files at the moment.

refs #3446

2015-02-05 14:09:25 +00:00 by jflach 3f79e4f

Add CLI command to collect logs

Currently only works for windows!
By calling `icinga2 troubleshoot collect [--console]` a small file
containing basic application information and a tail of all found logs
and the latest crash report will be created [or displayed].
It does not collect config files at the moment.

refs #3446

2015-02-09 08:33:27 +00:00 by jflach 22d351e

Add CLI command to collect logs

Currently only works for windows!
By calling `icinga2 troubleshoot collect [--console]` a small file
containing basic application information and a tail of all found logs
and the latest crash report will be created [or displayed].
It does not collect config files at the moment.

refs #3446

2015-02-09 11:48:11 +00:00 by jflach 45ca55b

Add CLI command to collect logs

Currently only works for windows!
By calling `icinga2 troubleshoot collect [--console]` a small file
containing basic application information and a tail of all found logs
and the latest crash report will be created [or displayed].
It does not collect config files at the moment.

refs #3446

2015-02-09 14:07:51 +00:00 by jflach abecfc8

Add CLI command to collect logs

Currently only works for windows!
By calling `icinga2 troubleshoot collect [--console]` a small file
containing basic application information and a tail of all found logs
and the latest crash report will be created [or displayed].
It does not collect config files at the moment.

refs #3446

2015-02-10 15:41:30 +00:00 by jflach 53ca1dd

Rework most of the troubleshoot cli feature.

TODO:
  config validation
  cluster support
  hints based on enabled/disabled features (ex. no debug log enabled)
  check livestatus, DB IDO
  check system health maybe? (free disk space, load etc.)

refs #3446

2015-02-11 08:35:32 +00:00 by jflach fc2993c

Fixes compilation bug

refs #3446

2015-02-12 13:41:00 +00:00 by jflach 86e1316

Add CLI command to collect logs

Currently only works for windows!
By calling `icinga2 troubleshoot collect [--console]` a small file
containing basic application information and a tail of all found logs
and the latest crash report will be created [or displayed].
It does not collect config files at the moment.

refs #3446

2015-02-12 13:41:00 +00:00 by jflach 7ce2e9d

Rework most of the troubleshoot cli feature.

TODO:
  config validation
  cluster support
  hints based on enabled/disabled features (ex. no debug log enabled)
  check livestatus, DB IDO
  check system health maybe? (free disk space, load etc.)

refs #3446

2015-02-12 13:41:00 +00:00 by jflach f652ab4

Fixes compilation bug

refs #3446

2015-02-13 14:46:23 +00:00 by jflach d1fe23b

Add CLI command to collect logs

By calling `icinga2 troubleshoot collect [--console]` a small file
containing basic application information and a tail of all found logs
and the latest crash report will be created [or displayed].
It does not collect config files at the moment.

refs #3446

2015-02-15 11:38:28 +00:00 by jflach cc5a8da

CLI: Add 'troubleshoot collect' command

By calling `icinga2 troubleshoot collect [--console]` a small file
containing basic application information and a tail of all found logs
and the latest crash report will be created [or displayed].
It does not collect config files at the moment.

refs #3446

2015-02-19 16:12:32 +00:00 by jflach 1a9c4ce

Restructure troubleshootcollect, more after the jump

Changed `--output-file` to `--output`
Default output file now has a timestamp in the name, no more overwriting
Added Section headers and file markers
Taken time is now measured and output
And some format changes were made

refs #3446

2015-02-20 14:27:53 +00:00 by mfriedrich 6455ef6

Cli: More code style fixes in 'troubleshoot' command

refs #3446

2015-02-20 15:13:25 +00:00 by jflach 41f7ec9

Improve coding style conformation

refs #3446

2015-02-25 14:01:03 +00:00 by jflach a026d47

Add documentation for the troubleshoot command

refs #3446

2015-02-26 11:43:43 +00:00 by jflach cc99406

Add --include-vars and --include-objects troubleshoot cli

refs #3446

2015-02-27 13:09:26 +00:00 by jflach 07fd4e6

Add colours to troubleshoot cli

refs #3446

2015-03-02 13:37:58 +00:00 by (unknown) 1f9a719

Fix output formatting in troubleshoot cli command

refs #3446

2015-03-02 14:28:02 +00:00 by (unknown) 97ff17e

Fix troubleshooting cli hint text

refs #3446

Subtasks:

Relations:

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2013-03-20 12:06:25 +00:00

  • Target Version set to 88

quite the same attempt as in #2551 - should be kept in mind for the final release, collecting all possible data from the users environment in order to get a better idea about the issue(s).

@icinga-migration
Copy link
Author

Updated by gbeutner on 2013-05-14 07:58:06 +00:00

  • Target Version changed from 88 to 89

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2013-08-26 14:13:44 +00:00

  • Status changed from New to Assigned
  • Assigned to set to Frankstar

@franz

please have a look into that.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2013-10-22 09:03:22 +00:00

  • Target Version deleted 89

@icinga-migration
Copy link
Author

Updated by berk on 2013-10-28 08:06:24 +00:00

  • Target Version set to 0.0.5

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2013-11-11 09:15:58 +00:00

  • Target Version deleted 0.0.5

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-03-18 10:42:33 +00:00

  • Target Version set to 186

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-03-18 16:21:47 +00:00

  • Target Version deleted 186

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-04-29 15:53:19 +00:00

Any updates?

@icinga-migration
Copy link
Author

Updated by Frankstar on 2014-06-18 16:01:47 +00:00

Looked over my "old work" and prepared for a 2.x release.
Should the Script still be Perl or should we prefer a Phyton script ?

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-06-18 16:12:11 +00:00

choose whatever fits best for you. python is reasonable and can be maintained by multiple.

@icinga-migration
Copy link
Author

Updated by Frankstar on 2014-07-28 09:26:16 +00:00

How should we handle the Database checks ?
should we install the needed drivers to python (MySQLdb, psycopg2) on the systems ? (i think there are people who dont like such a solution)

or maybe i provide the installation routine in the script and the user can choose if he want too install the needed driver ?
Or remove the database checks completely from the script ?

We can also get the information we need from commandline - but i dont like the solution and its more "fault-prone"

any ideas are welcome.

@icinga-migration
Copy link
Author

Updated by Frankstar on 2014-07-28 12:08:51 +00:00

Current Output from the Script:

feel free to test the script on you host and submit any feedback.
icinga_check.py

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-07-28 15:50:11 +00:00

Looks good. Does it run on Python 2.4 and el5?
Can we remove the header, and replace it with a simple "icinga 2 verify" text?

@icinga-migration
Copy link
Author

Updated by Frankstar on 2014-07-29 10:37:22 +00:00

Header changed and no it doesn't work on Python 2.4.3
But you can install python 2.6.8 on el5 via yum and the epel repository.

yum install python26

and start the script via python 2.6.

python26 icinga_check.py

so we can note this in wiki or documentation.
i dont think it make sense to adjust the script for python 2.4.x

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-07-29 10:46:52 +00:00

Isn't that the whole purpose of making this script portable on all supported distributions (that is, el5 and sles11 until 2020)?

Imho Python 2.4 is a requirement. Users should just run the script and tell the support guy asking for it. Installing a separate dependency (which could conflict with support policies!) shouldn't be the case here.

@icinga-migration
Copy link
Author

Updated by Frankstar on 2014-07-29 11:13:54 +00:00

it is, im aware of our supported Distributions.
i cant be aware of python < 2.6.x cause lack of knowledge and time.

maybe i can port it later or some else can port it back.

@icinga-migration
Copy link
Author

Updated by Frankstar on 2014-07-29 13:53:39 +00:00

its working under el5 and python 2.4.x now.
f790997

But there is a Bug if you are running the script under Windows.
Will get rid of it later.

@icinga-migration
Copy link
Author

Updated by Frankstar on 2014-07-31 17:11:32 +00:00

Thats the output so far.

whats next ?
what do we need to check ?
what info do we need too troubleshoot.

For a Log Collector i need sample output of errors we want parse.

@icinga-migration
Copy link
Author

Updated by TechIsCool on 2014-08-01 01:20:53 +00:00

Just a FYI I am on Ubuntu Trusty x64 and downloaded and ran your script it crashes like this @administratorvitals:~$ sudo python icinga_check.py

Icinga2 Verify Script:

Script Warnings:
No non-critical Service Binary found: ['snmptt', 'npcd']

System Information:
OS: jessie/sid
Kernel: 3.13.0-24-generic x86_64
LANG: en_US,UTF-8

Python Ver.: 2.7.6
[Thu Jul 31 18:17:53.282287 2014] [core:warn] [pid 25242] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
[Thu Jul 31 18:17:53.282721 2014] [core:warn] [pid 25242] AH00111: Config variable ${APACHE_PID_FILE} is not defined
[Thu Jul 31 18:17:53.282997 2014] [core:warn] [pid 25242] AH00111: Config variable ${APACHE_RUN_USER} is not defined
[Thu Jul 31 18:17:53.283342 2014] [core:warn] [pid 25242] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
[Thu Jul 31 18:17:53.283625 2014] [core:warn] [pid 25242] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Thu Jul 31 18:17:53.288497 2014] [core:warn] [pid 25242:tid 140612141414272] AH00111: Config variable ${APACHE_RUN_DIR} is not defined
[Thu Jul 31 18:17:53.290111 2014] [core:warn] [pid 25242:tid 140612141414272] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Thu Jul 31 18:17:53.290779 2014] [core:warn] [pid 25242:tid 140612141414272] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Thu Jul 31 18:17:53.291104 2014] [core:warn] [pid 25242:tid 140612141414272] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf:
Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}
Apache Ver.:
Traceback (most recent call last):
File "icinga_check.py", line 350, in
main()
File "icinga_check.py", line 333, in main
apache_info()
File "icinga_check.py", line 261, in apache_info
print "Apache Ver.:", short.group(1)
AttributeError: 'NoneType' object has no attribute 'group'
administrator@vitals:~$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>
administrator@vitals:~$

@icinga-migration
Copy link
Author

Updated by Frankstar on 2014-08-01 07:40:58 +00:00

First Thank you for testing.
Second, the main error is not from the script itself.

It seems your apache install is broken.
but i will fix it so the script wont stop on such errors.

@icinga-migration
Copy link
Author

Updated by gbeutner on 2014-08-01 07:52:58 +00:00

# ./icinga_check.py
====================================================================
Icinga2 Verify Script:
====================================================================
Script Warnings:
No non-critical Service Binary found: ['snmptt', 'npcd'] 

System Information:
OS: jessie/sid
Kernel: 3.13.0-32-generic x86_64
LANG: en_US,UTF-8

Python Ver.: 2.7.6
PHP Ver.: 5.5.9
Apache Ver.:
Traceback (most recent call last):
  File "./icinga_check.py", line 411, in 
    main()
  File "./icinga_check.py", line 392, in main
    apache_info()
  File "./icinga_check.py", line 281, in apache_info
    print "Apache Ver.:", short.group(1)
AttributeError: 'NoneType' object has no attribute 'group'

"apache2 -V" should probably be "apache2 -v" instead:

# apache2 --help
[Fri Aug 01 09:52:17.304143 2014] [core:warn] [pid 31285] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
[Fri Aug 01 09:52:17.304369 2014] [core:warn] [pid 31285] AH00111: Config variable ${APACHE_PID_FILE} is not defined
[Fri Aug 01 09:52:17.304411 2014] [core:warn] [pid 31285] AH00111: Config variable ${APACHE_RUN_USER} is not defined
[Fri Aug 01 09:52:17.304438 2014] [core:warn] [pid 31285] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
[Fri Aug 01 09:52:17.304491 2014] [core:warn] [pid 31285] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Fri Aug 01 09:52:17.324203 2014] [core:warn] [pid 31285] AH00111: Config variable ${APACHE_RUN_DIR} is not defined
[Fri Aug 01 09:52:17.325792 2014] [core:warn] [pid 31285] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Fri Aug 01 09:52:17.326988 2014] [core:warn] [pid 31285] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Fri Aug 01 09:52:17.327066 2014] [core:warn] [pid 31285] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Fri Aug 01 09:52:17.327357 2014] [core:warn] [pid 31285] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Fri Aug 01 09:52:17.327417 2014] [core:warn] [pid 31285] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf:
Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}

# apache2 -v
Server version: Apache/2.4.7 (Ubuntu)
Server built:   Jul 22 2014 14:36:38

@icinga-migration
Copy link
Author

Updated by gbeutner on 2014-08-01 07:54:27 +00:00

Also, on Debian the user Icinga runs as is nagios

[CRIT] check_disk -c 5%: Cant run check_disk with user "icinga"

@icinga-migration
Copy link
Author

Updated by gbeutner on 2014-08-01 07:55:18 +00:00

Other than that it seems to work on Ubuntu 14.04 (after fixing the BOM and shebang issues):

# ./icinga_check.py
====================================================================
Icinga2 Verify Script:
====================================================================
Script Warnings:
No non-critical Service Binary found: ['snmptt', 'npcd'] 

System Information:
OS: jessie/sid
Kernel: 3.13.0-32-generic x86_64
LANG: en_US,UTF-8

Python Ver.: 2.7.6
PHP Ver.: 5.5.9
Apache Ver.: Apache/2.4.7 (Ubuntu)
DB Server Ver.: mysql  Ver 14.14 Distrib 5.5.38,

Icinga Checks:
Icinga Ver.: v2.0.1-33-gdfd3091
Enabled Features:
api, checker, command, ido-mysql
livestatus, mainlog, notification, perfdata


[OK] IDO Programstatus: 2014-08-01 09:52:53
[CRIT] check_disk -c 5%: Cant run check_disk with user "icinga"

Essential Service Checks:
[OK] icinga2  - is running
[OK] mysql  - is running
[OK] apache2  - is running

non-critical Service Checks:
====================================================================

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-08-01 07:56:13 +00:00

I've tested the script and there are some problems:

  • remove the bom
  • make the shebang work on any env
  • chmod 755
  • generic copyright (see tools/scripts/process_check_result)

Attached is a patch including these fixes. Please review & apply.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-08-01 07:56:19 +00:00

  • File deleted 0001-Fix-bom-env-shebang-add-generic-copyright-header.patch

@icinga-migration
Copy link
Author

Updated by Frankstar on 2014-08-01 08:54:37 +00:00

gunnarbeutner wrote:

Also, on Debian the user Icinga runs as is nagios

[...]

what is this ?
makes absolute sense ....

icinga2 doesnt store that user in any of the configuration files, right ?
(like icigna 1.x in /icinga.cfg", 'icinga_user')

@icinga-migration
Copy link
Author

Updated by gvegidy on 2014-08-04 20:24:32 +00:00

Frankstar wrote:

icinga2 doesnt store that user in any of the configuration files, right ?
(like icigna 1.x in /icinga.cfg", 'icinga_user')

no, the user is specified on the commandline and by default read from /etc/sysconfig/icinga2 (or similar, depending on the distro).

I think it would make sense to output the current user and group_s_ of the icinga2-process.

I suggest something like this:

egrep "(Uid|Gid|Groups)" /proc/`cat /var/run/icinga2/icinga2.pid`/status

if it isn't too much work, you could additionally decode the uids and gids to user/group names.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-11-09 15:11:29 +00:00

Please rewrite that functionality into a cli command, for example 'icinga2 info' using the existing cli command framework and bash auto-completion capabilities introduced with 2.2. Python can't be used as dependency for icinga2 anymore.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-11-09 15:13:19 +00:00

  • Relates set to 7246

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-11-09 15:13:41 +00:00

  • File deleted 0001-Fix-bom-env-shebang-add-generic-copyright-header.patch

@icinga-migration
Copy link
Author

Updated by Frankstar on 2014-11-19 07:57:10 +00:00

will have a look into that.
basically i should rewrite it into a shell script with the CLI functionality ?
I´m getting you right ?

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-11-19 09:21:16 +00:00

No. In C** inside of Icinga 2 code.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-01-28 10:04:19 +00:00

  • Category set to CLI
  • Assigned to changed from Frankstar to jflach

Review:

icinga2 -- Troubleshooting help:
When looking for help fixing your Application please provide this information.
Application information:
  • Add section headers (like "log", "features", etc)
  • Object overview:
    • How many objects (run config validation)
  • Missing features so far:

**** Livestatus: If enabled, try to execute a simple query

**** DB IDO: If enabled, fetch the database version ("SELECT * FROM icinga_dbversion;") - that requires reading the ido-*.conf files fetching the connection credentials

Basically any enabled feature should be tested and verified operational

  • Cluster
    • api feature enabled? -> collect zones/endpoints
  • Add content of configs if existing
    • icinga2.conf
    • zones.conf
    • don't add constants.conf (could contain credentials)
  • add a "tree" listing of files and folders inside SysconfDir + "/icinga2"
  • Allow to print the result to std::cout
    • Further allow to specify a path for the file to be stored (optional)

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-02-10 20:50:39 +00:00

Compiling your branch leads to the following error:

/home/michi/coding/icinga/icinga2/lib/cli/troubleshootcollectcommand.cpp:333:37: error: use of undeclared identifier 'GetVersion'
 os << "\tApplication version: " << GetVersion() << "\n"
                                    ^
1 error generated.
lib/cli/CMakeFiles/cli.dir/build.make:767: recipe for target 'lib/cli/CMakeFiles/cli.dir/troubleshootcollectcommand.cpp.o' failed
make[2]: *** [lib/cli/CMakeFiles/cli.dir/troubleshootcollectcommand.cpp.o] Error 1
make[2]: *** Warte auf noch nicht beendete Prozesse...
[ 45%] Building CXX object lib/icinga/CMakeFiles/icinga.dir/scheduleddowntime.cpp.o
[ 45%] Building CXX object lib/icinga/CMakeFiles/icinga.dir/scheduleddowntime-apply.cpp.o
make[2]: Leaving directory '/home/michi/coding/icinga/icinga2/debug'
CMakeFiles/Makefile2:1377: recipe for target 'lib/cli/CMakeFiles/cli.dir/all' failed
make[1]: *** [lib/cli/CMakeFiles/cli.dir/all] Error 2
make[1]: *** Warte auf noch nicht beendete Prozesse...

@icinga-migration
Copy link
Author

Updated by gbeutner on 2015-02-13 09:54:59 +00:00

  • Target Version set to 2.3.0

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-02-15 11:29:27 +00:00

  • Assigned to changed from jflach to mfriedrich
  • Done % changed from 0 to 70

Review

  • Rename --output-file to --output

  • Store the output file per default as "troubleshooting-YYYY-MM-DD-HH:mm:ss.log instead of overwriting it every time

  • Add section headers for better identification (e.g. for "general info", "features", "objects", etc)

  • Tell which Logger objects have been found (we don't know yet)

    Getting the last 20 lines of the 2 found FileLogger objects.

  • Better naming for sensitive information ("please make sure to remove any sensitive data such as credentials, internal company names, etc")

    please make sure to censor your sensible data

  • Put file and directory paths in single quotes for better readability

    Found zones configuration file at /etc/icinga2/zones.conf

  • wrap file content into markers, for example

    [begin:path/to/file.conf]

    [end:path/to/file.conf]

  • between icinga2.conf and zones.conf: "Config validation successful" - that should be in a more prominent spot, especially if there are errors (add a separate section)
  • if console is taken, use color support for better visualization (similar to the console commands, see object list or feature list for examples)
  • Measure the time it takes to collect the data and put start and end time into the log. It's important to see when this was collected, as well as how long it look (a slow hardware would indicate problems with i2 already parsing the debug file)

Future ideas

  • Find a way to connect to
    • DB IDO
    • Livestatus
    • Command Pipe
    • Icinga2 API

Please create separate issues for that and reference them here.

Wishlist

  • since you are reading the objects file already, it would be desirable to get a full dump of object list on-demand (e.g. per --include-objects). This should not be enabled by default, as this could become huge. Output should be the same as 'object list'.
  • read the variables too, and add them (there's already a cli command for that). Use --include-vars as this may contain sensitive information.
  • Add support for compressing the log (not sure if it's a good idea to add gzip dependency here, but let's discuss). If not possible, at least add instructions on stdout ("Here's the log, compress it with (Linux) bla (Windows) foo using this command...")

Conclusion

Good job so far! Glad it's been that's already that feature-rich :)

I'd say before continuing fixing the remaining tasks, we'll merge that to master. I'll take care of that.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-02-15 11:31:59 +00:00

Oh, and documentation is missing entirely.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-02-15 11:32:42 +00:00

  • Subject changed from Icinga: Log- and Config-Collector to Add troubleshooting collect cli command

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-02-15 11:40:19 +00:00

  • Assigned to changed from mfriedrich to jflach

Rebased against master, fixed changes in NetString::ReadStringFromStream(), pushed into the branch and also master.

There was a warning generated on compile.

/home/michi/coding/icinga/icinga2/lib/cli/troubleshootcollectcommand.cpp:70:13: warning: unused function 'PrintCrashReports' [-Wunused-function]
static void PrintCrashReports(std::ostream& os)
            ^
1 warning generated.

Please continue with fixes in the master branch.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-02-20 14:28:04 +00:00

Review

One-line if conditions w/o brackets.

        if (debug_info)
            configs.insert(debug_info->Get(0));

Log() function with shift operator requires 4 spaces indent (no tab!)

    InfoLogLine(log)
        << "Found the " << countTotal << " objects:"
        << "\tType" << std::string(typeL-4, ' ') << " : Count";

Same goes for function headers and other line breaks. No tab indent, but 4 spaces.

void TroubleshootCollectCommand::InitParameters(boost::program_options::options_description& visibleDesc,
     boost::program_options::options_description& hiddenDesc) const
{

@icinga-migration
Copy link
Author

Updated by gbeutner on 2015-02-24 12:28:26 +00:00

TODOs:

a) Rename "troubleshoot collect" to just "troubleshoot"
b) Add documentation
c) Update the ticket :P

@icinga-migration
Copy link
Author

Updated by jflach on 2015-02-25 14:57:42 +00:00

Missing features:

Estimated Time for the bottom three: 2-3 days. For the others, unknown.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-02-25 15:05:26 +00:00

Ok, then please implement the following bits until next week, priority top-down

  • --include-objects and --include-vars
  • Coloured output
  • Log compression (Possibly just a message telling to user to do so)

If log compression cannot be done in the end, skip it and create a referencing nice2have issue.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-03-02 08:12:05 +00:00

Please update the status.

@icinga-migration
Copy link
Author

Updated by jflach on 2015-03-02 08:35:42 +00:00

Coloured output:
Added easy way to colour output. It could be a bit more colourful though, yet I don't want to overdo it.

--include-objects and --include-vars:
Done, saves formatted output next to the troubleshoot.log

Log compression (Possibly just a message telling to user to do so):
Just message, ticket for improvement #8561

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-03-02 08:50:04 +00:00

Review

  • Time formatting -> make it human readable (header/footer only)
Began procedure at timestamp 1425286059.5999451

Finished collection at timestamp 1425286060.057282
  • wrap header / footer in separators making it clear.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-03-02 08:56:10 +00:00

@icinga-migration
Copy link
Author

Updated by jflach on 2015-03-02 15:54:25 +00:00

  • Status changed from Assigned to Closed
  • Backport? changed from __ to No
  • Include in Changelog changed from __ to 1

@icinga-migration icinga-migration added enhancement New feature or request area/cli Command line helpers labels Jan 17, 2017
@icinga-migration icinga-migration added this to the 2.3.0 milestone Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Command line helpers enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant