Foreman-debug script example output and discussion

Hello,

I finished testing of the foreman-debug script. Here is the candidate:

https://gist.github.com/lzap/5460551

This is how it looks like:

root@squeeze-foreman:~# ./foreman-debug -h
./foreman-debug - configuration and log data collector

USAGE: ./foreman-debug [options]

Collects configuration and log data for Foreman, Smart Proxies, backend
services and system information while removing security information like
passwords, tokens and keys.

This program can be used on Foreman instance, Smart Proxy instances or
backend services separatly.

OPTIONS:
-d DIR Directory to place the tarball in (default /tmp/foreman-XYZ)
-g Skip generic info (CPU, memory, firewall etc.)
-a Do not generate a tarball from the resulting directory
-m Maximum lines to keep for each file (default 5000)
-j PRG Filter with provided program when creating a tarball
-q Quiet mode
-v Verbose mode
-h Shows this message

And this is how it works:

root@squeeze-foreman:~# ./foreman-debug

HOSTNAME: squeeze-foreman.virtual.lan
OS: debian
RELEASE: 6.0.7
FOREMAN: 1.1-1
RUBY: ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]
PUPPET: 3.1.1

A debug file has been created: /tmp/foreman-debug-5jEuX.tar.xz (23708 bytes)

Attaching example tarball, please review and discuss. Missing something?
Found some sensitive data in it? Not working properly on your distro?
Feel free to send me a patch or comment.

foreman-debug-5jEuX.tar.xz (11.7 KB)

··· -- Later,

Lukas “lzap” Zapletal
irc: lzap #theforeman

> Hello,
>
> I finished testing of the foreman-debug script. Here is the candidate:
>
> https://gist.github.com/lzap/5460551
>
> This is how it looks like:
>
> root@squeeze-foreman:~# ./foreman-debug -h
> ./foreman-debug - configuration and log data collector
>
> USAGE: ./foreman-debug [options]
>
> Collects configuration and log data for Foreman, Smart Proxies, backend
> services and system information while removing security information like
> passwords, tokens and keys.
>
> This program can be used on Foreman instance, Smart Proxy instances or
> backend services separatly.
>
> OPTIONS:
> -d DIR Directory to place the tarball in (default /tmp/foreman-XYZ)
> -g Skip generic info (CPU, memory, firewall etc.)
> -a Do not generate a tarball from the resulting directory
> -m Maximum lines to keep for each file (default 5000)
> -j PRG Filter with provided program when creating a tarball
> -q Quiet mode
> -v Verbose mode
> -h Shows this message

fyi… this is what is katello.

Usage: katello-debug [options] command
–dir [DIRECTORY] Directory to place the tarball.
Defaults to /tmp
–notar Do not generate a tar file, just
copy the files to target dir
–help Display help and exit

the notar seems to be missing

>
> And this is how it works:
>
> root@squeeze-foreman:~# ./foreman-debug
>
>
> HOSTNAME: squeeze-foreman.virtual.lan
> OS: debian
> RELEASE: 6.0.7
> FOREMAN: 1.1-1
> RUBY: ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]
> PUPPET: 3.1.1
>
>
> A debug file has been created: /tmp/foreman-debug-5jEuX.tar.xz (23708 bytes)

What is the hash here? katello-debug uses a timestamp. That seems a bit
nicer when there are many of these flowing around

>
>
> Attaching example tarball, please review and discuss. Missing something?
> Found some sensitive data in it? Not working properly on your distro?
> Feel free to send me a patch or comment.
>

Looks good!

– bk

··· On 04/25/2013 11:25 AM, Lukas Zapletal wrote:

> Hello,
>
> I finished testing of the foreman-debug script. Here is the candidate:
>
> https://gist.github.com/lzap/5460551
>
> This is how it looks like:
>
> root@squeeze-foreman:~# ./foreman-debug -h
> ./foreman-debug - configuration and log data collector
>
> USAGE: ./foreman-debug [options]
>
> Collects configuration and log data for Foreman, Smart Proxies, backend
> services and system information while removing security information like
> passwords, tokens and keys.
>
> This program can be used on Foreman instance, Smart Proxy instances or
> backend services separatly.
>
> OPTIONS:
> -d DIR Directory to place the tarball in (default /tmp/foreman-XYZ)
> -g Skip generic info (CPU, memory, firewall etc.)
> -a Do not generate a tarball from the resulting directory
> -m Maximum lines to keep for each file (default 5000)
> -j PRG Filter with provided program when creating a tarball
> -q Quiet mode
> -v Verbose mode
> -h Shows this message
>
> And this is how it works:
>
> root@squeeze-foreman:~# ./foreman-debug
>
>
> HOSTNAME: squeeze-foreman.virtual.lan
> OS: debian
> RELEASE: 6.0.7
> FOREMAN: 1.1-1
> RUBY: ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]
> PUPPET: 3.1.1
>
>
> A debug file has been created: /tmp/foreman-debug-5jEuX.tar.xz (23708
> bytes)
>
>
> Attaching example tarball, please review and discuss. Missing something?
> Found some sensitive data in it? Not working properly on your distro?
> Feel free to send me a patch or comment.
>

its a great start!

while browsing a bit on the tar, i was missing foreman logs? and pg
commands failed.

thanks!
Ohad

··· On Thu, Apr 25, 2013 at 6:25 PM, Lukas Zapletal wrote:


Later,

Lukas “lzap” Zapletal
irc: lzap #theforeman


You received this message because you are subscribed to the Google Groups
"foreman-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Seems good, one thing I noticed - gem list did't show anything. Note that on
debian you can find gem1.8 and gem1.9.1 and /usr/bin/gem is just symlink to one
of them (via alternatives).

··· On Thursday 25 of April 2013 17:25:44 Lukas Zapletal wrote: > Hello, > > I finished testing of the foreman-debug script. Here is the candidate: > > https://gist.github.com/lzap/5460551 > > This is how it looks like: > > root@squeeze-foreman:~# ./foreman-debug -h > ./foreman-debug - configuration and log data collector > > USAGE: ./foreman-debug [options] > > Collects configuration and log data for Foreman, Smart Proxies, backend > services and system information while removing security information like > passwords, tokens and keys. > > This program can be used on Foreman instance, Smart Proxy instances or > backend services separatly. > > OPTIONS: > -d DIR Directory to place the tarball in (default /tmp/foreman-XYZ) > -g Skip generic info (CPU, memory, firewall etc.) > -a Do not generate a tarball from the resulting directory > -m Maximum lines to keep for each file (default 5000) > -j PRG Filter with provided program when creating a tarball > -q Quiet mode > -v Verbose mode > -h Shows this message > > And this is how it works: > > root@squeeze-foreman:~# ./foreman-debug > > > HOSTNAME: squeeze-foreman.virtual.lan > OS: debian > RELEASE: 6.0.7 > FOREMAN: 1.1-1 > RUBY: ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux] > PUPPET: 3.1.1 > > > A debug file has been created: /tmp/foreman-debug-5jEuX.tar.xz (23708 > bytes) > > > Attaching example tarball, please review and discuss. Missing something? > Found some sensitive data in it? Not working properly on your distro? > Feel free to send me a patch or comment.


Marek

> fyi… this is what is katello.

Yeah I heavily inspired from Katello and we are compatible, except for
simplicity I am not able to parse long options. I am using bash getopt
which only accepts short options, so foreman options are:

> --dir [DIRECTORY] Directory to place the tarball.
> > -d DIR Directory to place the tarball in (default /tmp/foreman-XYZ)

> --notar Do not generate a tar file,
> > -a Do not generate a tarball from the resulting directory

> --help Display help and exit
> > -h Shows this message

So it is -a instead --notar.

I wanted the script to KISS. :-X

My version is more simple compared to the Ruby version from Katello,
maybe folks could adopt it for katello as well once I finish with it.

··· On Thu, Apr 25, 2013 at 01:43:55PM -0400, Bryan Kearney wrote:


Later,

Lukas “lzap” Zapletal
irc: lzap #theforeman

Ok one more tarball with some more logs and also fixed psql and better
password filtering.

LZ

foreman-debug-tiXQO.tar.xz (11.2 KB)

··· On Thu, Apr 25, 2013 at 05:25:44PM +0200, Lukas Zapletal wrote: > Hello, > > I finished testing of the foreman-debug script. Here is the candidate: > > https://gist.github.com/lzap/5460551 > > This is how it looks like: > > root@squeeze-foreman:~# ./foreman-debug -h > ./foreman-debug - configuration and log data collector > > USAGE: ./foreman-debug [options] > > Collects configuration and log data for Foreman, Smart Proxies, backend > services and system information while removing security information like > passwords, tokens and keys. > > This program can be used on Foreman instance, Smart Proxy instances or > backend services separatly. > > OPTIONS: > -d DIR Directory to place the tarball in (default /tmp/foreman-XYZ) > -g Skip generic info (CPU, memory, firewall etc.) > -a Do not generate a tarball from the resulting directory > -m Maximum lines to keep for each file (default 5000) > -j PRG Filter with provided program when creating a tarball > -q Quiet mode > -v Verbose mode > -h Shows this message > > And this is how it works: > > root@squeeze-foreman:~# ./foreman-debug > > > HOSTNAME: squeeze-foreman.virtual.lan > OS: debian > RELEASE: 6.0.7 > FOREMAN: 1.1-1 > RUBY: ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux] > PUPPET: 3.1.1 > > > A debug file has been created: /tmp/foreman-debug-5jEuX.tar.xz (23708 bytes) > > > Attaching example tarball, please review and discuss. Missing something? > Found some sensitive data in it? Not working properly on your distro? > Feel free to send me a patch or comment. > > -- > Later, > > Lukas "lzap" Zapletal > irc: lzap #theforeman > > -- > You received this message because you are subscribed to the Google Groups "foreman-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an email to foreman-dev+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > >


Later,

Lukas “lzap” Zapletal
irc: lzap #theforeman

Gems are vendored on the Debian packages - use bundle exec gem list in the
foreman dir.

Greg

··· On 26 April 2013 07:24, Marek Hulan wrote:

Seems good, one thing I noticed - gem list did’t show anything. Note that
on
debian you can find gem1.8 and gem1.9.1 and /usr/bin/gem is just symlink
to one
of them (via alternatives).

Should be there, I think the instance just did not get started. Will
investigate.

··· On Thu, Apr 25, 2013 at 08:32:42PM +0300, Ohad Levy wrote: > its a great start! > > while browsing a bit on the tar, i was missing foreman logs? and pg > commands failed.


Later,

Lukas “lzap” Zapletal
irc: lzap #theforeman

This is what I do:

add_cmd "gem list" "gem_list"
add_cmd "bundle --local --gemfile=/usr/share/foreman/Gemfile"
"bundle_list"

I dont think it makes sense to do bundle exec gem list since it should
give the same output as bundle --local.

So I am going to remove gem list command, okay?

LZ

··· On Fri, Apr 26, 2013 at 10:15:09AM +0100, Greg Sutcliffe wrote: > On 26 April 2013 07:24, Marek Hulan wrote: > > > > > Seems good, one thing I noticed - gem list did't show anything. Note that > > on > > debian you can find gem1.8 and gem1.9.1 and /usr/bin/gem is just symlink > > to one > > of them (via alternatives). > > > > Gems are vendored on the Debian packages - use bundle exec gem list in the > foreman dir. > > Greg > > -- > You received this message because you are subscribed to the Google Groups "foreman-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an email to foreman-dev+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > >


Later,

Lukas “lzap” Zapletal
irc: lzap #theforeman

Ok my testing instance is sqlite and log is not in /var/log/foreman :slight_smile:

Anyone willing to run the script on a non-production instance (but
package based installation)?

I will send one more tarball, hopefully with more info.

··· On Fri, Apr 26, 2013 at 03:23:52PM +0200, Lukas Zapletal wrote: > On Thu, Apr 25, 2013 at 08:32:42PM +0300, Ohad Levy wrote: > > its a great start! > > > > while browsing a bit on the tar, i was missing foreman logs? and pg > > commands failed. > > Should be there, I think the instance just did not get started. Will > investigate.


Later,

Lukas “lzap” Zapletal
irc: lzap #theforeman

> Anyone willing to run the script on a non-production instance (but
> package based installation)?
Hi

here an attachment from el6 machine with foreman installed from "katello"
foreman packages. Let me know if you'd like me to test anything else.

foreman-debug-L0keb.tar.xz (12.6 KB)

··· -- Marek