reportreader.rb
- This tool was created because a google search for CLI report reader returned: nada.
- reportreader.rb is useful for creating crontabs that report on changes made in a certain time period.
- I have mine set to report hourly on changes that occur in the infrastructure.
- Eventually, I may come to rely on something like Dashboard or Foreman, but for now, this meets my requirements.
- It’ll do interactive and non-interactive. I’m adding more features as the need presents itself. =D
Get it here.
Usage: puppet_tools/reportreader.rb [options]
-t, –time PARAM Time scope by hours from now: default is 12
-s, –hostname PARAM Identify hostname to check. Or use ‘all’ for all
-c, –changes Print changed resources
-l, –logs Print logs from changed resources
-v, –verbose Increase verbosity
-f, –reportdir PARAM Identify reports directory (default: /var/lib/puppet/reports)
-h, –help Display this screen
jim@netops2s:~/opt$
Sample output:
jim@netops2s:~/opt$ puppet_tools/reportreader.rb -t 1 -s testpup5-7.domain.com -c -f reports
Report: testpup5-7.domain.com Tue Mar 20 13:43:13 -0500 2012 changed
Exec[/usr/sbin/usermod -a -G netops someuser]
resource: Exec[/usr/sbin/usermod -a -G somegroup someuser]
change_count: 1
out_of_sync_count: 1
file: /etc/puppet/environments/trunk/modules/users/manifests/users/somegroup.pp
line: 39
evaluation_time: 0.381353
time: Tue Mar 20 13:43:27 -0500 2012
Exec[/usr/sbin/usermod -a -G someothergroup someotheruser]
resource: Exec[/usr/sbin/usermod -a -G someothergroup someotheruser]
change_count: 1
out_of_sync_count: 1
file: /etc/puppet/environments/trunk/modules/users/manifests/users/someothergroup.pp
line: 39
evaluation_time: 0.382155
time: Tue Mar 20 13:43:28 -0500 2012
User[someuser]
resource: User[someuser]
change_count: 1
out_of_sync_count: 1
file: /etc/puppet/environments/trunk/modules/users/manifests/users/virtual.pp
line: 310
evaluation_time: 0.173059
time: Tue Mar 20 13:43:27 -0500 2012
User[someotheruser]
resource: User[someotheruser]
change_count: 1
out_of_sync_count: 1
file: /etc/puppet/environments/trunk/modules/users/manifests/users/virtual.pp
line: 350
evaluation_time: 0.157976
time: Tue Mar 20 13:43:26 -0500 2012