alamode-sentry
alamode-publish
results.html.erb
index.css
index.js
bootstrap.min.css
bootstrap.min.js
jquery-1.9.1.min.js
The specific commands used to collect information are detailed in the alamode-sentry
script.
Information is saved in a text file with the same name as the machine from which it was gathered (no file extension). One file is created for each machine and contains one line for each property, with the exception of the interrupts table. The lines are of the format key=value
, using the following keys:
cpu_utilization
- The entire CPU utilization string provided bytop
, which is then separated into:cpu_utilization_hi
- Hardware interruptscpu_utilization_idle
- Idlecpu_utilization_ni
- Nicecpu_utilization_si
- Software interruptscpu_utilization_st
- Steal timecpu_utilization_system
- Systemcpu_utilization_user
- Usercpu_utilization_wa
- I/O Wait
date
- The current date when the information is collectedload_avg_01min
- Load average for the last 1 minuteload_avg_05min
- Load average for the last 5 minutesload_avg_15min
- Load average for the last 15 minutes- For each cache level in
cache_levels
:LEVEL\*_DCACHE_SIZE
- Size, in kB, if there is a data cache for this levelLEVEL\*_ICACHE_SIZE
- Size, in kB, if there is an information cache for this levelLEVEL\*_CACHE_SIZE
- Size, in kB, if there is a unified cache for this level
memory_free
- Free memory, in kBmemory_total
- Total memory, in kBnum_users
- The number of users logged inprocesses_total
- The total number of processes, divided into:processes_num_running
- The number of running processesprocesses_num_sleeping
- The number of sleeping processesprocesses_num_stopped
- The number of stopped processesprocesses_num_zombie
- The number of zombie processes
processor_name
- The human-readable processor nameprocessor_num_real_cores
- The number of real processor coresprocessor_num_virt_cores
- The number of virtual processor coresprocessor_speed
- The nominal processor speed, in GHztable_interrupt_data
- This key is written last, on its own line, and followed by the comma-delimited output ofcat /proc/interrupts
alamode-sentry
is used to collect information about a host or hosts. alamode-publish
generates HTML to display this information, with styling and behavoir povided by Bootstrap. Basic instructions for viewing the information are given in a banner at the top of the generated HTML page. In addition to marking a host as unreachable, the user is informed of any SSH errors when running alamode-sentry
so that they know exactly what went wrong. This is the only other output given besides the location of the saved information, which is given last so that it can be piped. The interrupts table is modified to be comma-delimited for easier parsing when generating the HTML. The table is then diplayed in HTML exactly as it appears after running cat /proc/interrupts
. There's a lot of extra logic in alamode-publish
to handle edge cases not caught by Ruby's OptionParser module. If no input flag is given, the script defaults to reading from stdin
. Otherwise, the user must specify a directory to read from and the script exits if the directory does not exist. The generated HTML is always saved as index.html
in the output directory. The resources used for styling and behavior (Bootstrap and jQuery) are included with the scripts. Each resource is referenced by its absolute path in the file system (as determined by Ruby's File.expand_path
method) rather than its position relative to the HTML file, so all of the resources must remain in the same directory as alamode-publish
. When viewing the final result, the color of each hostname is styled to indicate its "rating"; light gray if unreachable, green if good, yellow if somewhat burdened, and red if extremely taxed. CPU utilization, memory usage, and types of processes are displayed using progress bars, with the option to click on the row to show/hide details. The number and types of processes are shown using stacked progress bars, color-coded and with a mouseover tooltip to display which one is which. Clicking the row shows/hides the exact numbers of each. The interrupts table is collapsed by default due to its size.