<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: J. Bobby Lopez</title>
    <description>The latest articles on Forem by J. Bobby Lopez (@jbobbylopez).</description>
    <link>https://forem.com/jbobbylopez</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F650870%2F3abced8e-1c83-4f42-ad07-6a7b92404585.png</url>
      <title>Forem: J. Bobby Lopez</title>
      <link>https://forem.com/jbobbylopez</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/jbobbylopez"/>
    <language>en</language>
    <item>
      <title>‘hi’ shows it’s colors</title>
      <dc:creator>J. Bobby Lopez</dc:creator>
      <pubDate>Sun, 21 Jul 2024 04:39:48 +0000</pubDate>
      <link>https://forem.com/jbobbylopez/hi-shows-its-colors-57f4</link>
      <guid>https://forem.com/jbobbylopez/hi-shows-its-colors-57f4</guid>
      <description>&lt;p&gt;I previously introduced &lt;a href="https://thedevopsjoint.com/2024/07/06/introducing-hi-the-host-information-tool/" rel="noopener noreferrer"&gt;‘hi’ – the Host Information tool &lt;/a&gt;to the world and described it’s base functionality. Later, &lt;a href="https://dev.to/jbobbylopez/saying-hi-to-your-linux-host-information-4fh6"&gt;I described how hi can be used to craft more complex notifications&lt;/a&gt;. In this article, I’ll describe some of the latest features implemented as part of the &lt;a href="https://github.com/jbobbylopez/hi/releases/tag/0.4.5" rel="noopener noreferrer"&gt;v0.4.5 pre-release&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
Get ‘hi’ on GitHub: &lt;a href="https://github.com/jbobbylopez/hi" rel="noopener noreferrer"&gt;https://github.com/jbobbylopez/hi&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Logging and State Management
&lt;/h2&gt;

&lt;p&gt;One of the biggest features introduced is the use of the logging module to implement a logging facility to log every status change event detected by the ‘hi’ tool. State is captured as a JSON file, which is then compared against the current state of each check. If there is a difference, a log is written, and the last state is updated with the current state information.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  State file example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;➤ cat state.json 
{
    "Systems": "FAIL",
    "ExpressVPN": "SUCCESS",
    "KeepassXC": "FAIL",
    "sshd": "SUCCESS",
    "signal-desktop": "FAIL",
    "Dropbox": "SUCCESS",
    "Galaxy S20 (sshfs)": "FAIL",
    "vdc2022nas": "SUCCESS",
    "wdred-8tb-pro-01": "SUCCESS",
    "Apache NiFi": "FAIL",
    "Open WebUI": "SUCCESS",
    "Thunderbird": "SUCCESS",
    "qbittorrent": "SUCCESS",
    "minidlna": "FAIL",
    "Steam": "FAIL",
    "CUPS": "SUCCESS",
    "Data Backup": "SUCCESS",
    "dockerd": "SUCCESS",
    "vi": "SUCCESS",
    "Midnight Commander": "FAIL",
    "tmux": "SUCCESS"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;h3&gt;
  
  
  ‘hi’ Logging Functionality
&lt;/h3&gt;

&lt;p&gt;Log files are written in JSONL (JSON Lines) format, to make it easy to consume by other upstream log and API analytics and monitoring tools.&lt;/p&gt;

&lt;p&gt;Tools such as Logstash, Graylog, Nagios, Zabbix, Splunk, Kibana, Datadog, and so on can easily ingest JSONL formatted logs, which makes it easy for these tools to parse and index the log data to generate simple or complex reports and notifications as required.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Log file example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;➤ tail hi_log.json 
{"timestamp": "2024-07-20T21:26:15.546248Z", "level": "INFO", "message": "vi state changed from SUCCESS to FAIL", "check_name": "vi", "previous_state": "SUCCESS", "new_state": "FAIL"}
{"timestamp": "2024-07-20T21:27:38.308707Z", "level": "INFO", "message": "sshd state changed from SUCCESS to FAIL", "check_name": "sshd", "previous_state": "SUCCESS", "new_state": "FAIL"}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;p&gt;Logs are only written when there is a status change for any of the checks being monitored.&lt;/p&gt;

&lt;p&gt;Logging can be enabled in the config.ini file.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  config/config.ini example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; [Paths]    
 checks_file = config/checks.yml    
 log_file = hi_log.json    

 [Report]    
 header_style = bold bright_magenta on black    
 hostname_style = magenta on black    
 ip_style = bold bright_green on black    

 [Tables]    
 number_of_columns = 3     
 default_style = green on black    
 header_style = bright_green    
 border_style = bright_white    
 column_style = bright_magenta     
 text_style = None    

 [OS Bar]    
 os_text_style = bright_red on black    

 [Logging]    
 enable_logging = true 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;h2&gt;
  
  
  Color Customization
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Because, Why Not.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you are going to use a terminal regularly, you want your tools to look good. Well, at least I do. Some tools offer minimal choices regarding terminal color and styling options. Some offer a lot of options but make it rather difficult to customize quickly.&lt;/p&gt;

&lt;p&gt;I know my personal taste in terminal color and styling choices may not be for everyone. So, I decided to make the ‘hi’ tool output easily customizable.&lt;/p&gt;

&lt;p&gt;Below are just some of the possibilties for display customization you now have with the ‘hi’ tool:&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Magenta on Magenta Color Scheme
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgnfnljcj6hfo80f1dkf2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgnfnljcj6hfo80f1dkf2.png" alt="Magenta on Magenta Color Scheme" width="800" height="557"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Green on Green Color Scheme
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp4lcvvm6gxkp08skbcuh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp4lcvvm6gxkp08skbcuh.png" alt="Green on Green Color Scheme" width="800" height="557"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Green on Black Color Scheme
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fysgb3rznb7wor6tp1bpi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fysgb3rznb7wor6tp1bpi.png" alt="Green on Black Color Scheme" width="800" height="557"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Blue and Black Color Scheme
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb2ejkdpxhnspbt7p19xf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb2ejkdpxhnspbt7p19xf.png" alt="Blue and Black Color Scheme" width="800" height="557"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Magenta on Black Color Scheme
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdicx5fie1ljorg39y4tr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdicx5fie1ljorg39y4tr.png" alt="Magenta on Black Color Scheme" width="800" height="557"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;With the new logging and state tracking capabilities, along with customizable color schemes, the ‘hi’ tool paves the way for further expansion, opening doors for integration with other command-line or API-oriented tools that utilize standard JSON formatted outputs.&lt;/p&gt;

&lt;p&gt;I would love your feedback on this tool! There are always bugs to fix and features to add as outlined in our ROADMAP.md, but I can’t catch everything on my own. Please don’t hesitate to reach out via GitHub if you encounter any issues or have suggestions. Sometimes the fix is as simple as an update or clarification in the README.md, and I’m more than happy to address it.&lt;/p&gt;

&lt;p&gt;Thanks for checking out ‘hi,’ the Host Information tool! Let’s make monitoring more efficient together.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/jbobbylopez/hi" rel="noopener noreferrer"&gt;Join the discussion and contribute on GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This article is cross-posted from &lt;a href="https://thedevopsjoint.com/2024/07/20/hi-shows-its-colors/" rel="noopener noreferrer"&gt;'hi' shows its colors&lt;/a&gt; on &lt;a href="https://thedevopsjoint.com/" rel="noopener noreferrer"&gt;thedevopsjoint.com&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>monitoring</category>
      <category>linux</category>
      <category>cli</category>
      <category>bash</category>
    </item>
    <item>
      <title>Saying "hi" to your Linux Host Information</title>
      <dc:creator>J. Bobby Lopez</dc:creator>
      <pubDate>Sun, 07 Jul 2024 19:23:29 +0000</pubDate>
      <link>https://forem.com/jbobbylopez/saying-hi-to-your-linux-host-information-4fh6</link>
      <guid>https://forem.com/jbobbylopez/saying-hi-to-your-linux-host-information-4fh6</guid>
      <description>&lt;p&gt;I wanted to share a little tool that I think you'll find to be a joy to use. Especially if you are a command-line enthusiast like myself. &lt;/p&gt;

&lt;p&gt;Say hello to "hi", my "Linux Host Information Reporting" tool.&lt;/p&gt;

&lt;p&gt;I've written a little bit previously about this tool in &lt;a href="https://thedevopsjoint.com/2024/07/06/introducing-hi-the-host-information-tool/" rel="noopener noreferrer"&gt;Introducing ‘hi’ – the Host Information tool&lt;/a&gt;, so in this article, I'll just dive into what this tool does, and how to use it.&lt;/p&gt;

&lt;p&gt;Firstly, you'll need to know where to get it. "hi" can be found on GitHub at &lt;a href="https://github.com/jbobbylopez/hi" rel="noopener noreferrer"&gt;https://github.com/jbobbylopez/hi&lt;/a&gt;.  Currently published release is a &lt;a href="https://github.com/jbobbylopez/hi/releases/tag/0.4.1" rel="noopener noreferrer"&gt;0.4.1 pre-release&lt;/a&gt;, so this tool is still in it's early development stages.  Some tests have been defined in &lt;code&gt;test_host_information.py&lt;/code&gt;, and will continue to be improved in order to guide development.&lt;/p&gt;

&lt;p&gt;Once you check-out that repository, one of the first things you'll notice is that there is no script, file, or binary called 'hi'.  The script is actually called &lt;code&gt;host_information.py&lt;/code&gt;.  There are instructions in the README.md for how to setup an alias to get the 'hi' command configured correctly.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is 'hi'?
&lt;/h2&gt;

&lt;p&gt;"hi" is a command-line tool designed to monitor and display the status of various services running on a host. The services and their respective checks are customizable via a YAML configuration file, allowing for flexibility to suit different monitoring needs. This tool leverages the Rich library to provide visually pleasing output that includes UTF8 status icons, so it should be run in a terminal that supports the UTF8 character-set.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Features&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Highly customizable checks that can report on any command-line executable status.&lt;/li&gt;
&lt;li&gt;Verifies the running status of various services.&lt;/li&gt;
&lt;li&gt;Checks the last modified date of backup logs to ensure up-to-date backups.&lt;/li&gt;
&lt;li&gt;Monitors the connectivity status of ExpressVPN.&lt;/li&gt;
&lt;li&gt;Displays the local IP address and hostname of the host.&lt;/li&gt;
&lt;li&gt;Utilizes the Rich library for visually appealing console output with UTF8 status icons.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is an example of the output that 'hi' reports in the terminal:&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsz0ogt58jkbpif71wcjk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsz0ogt58jkbpif71wcjk.png" alt="example output" width="800" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using 'hi info', you can get some extended information reported from the 'info:' section of the check.yml configuration.&lt;/p&gt;

&lt;p&gt;"hi info" output:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffwt4nxigaoa8svhob3q1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffwt4nxigaoa8svhob3q1.png" alt="hi info output" width="800" height="470"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Groups can be customized in the config/groups.yml file, and only those system checks configured with the groups defined will be reported. &lt;/p&gt;

&lt;p&gt;Example of the groups.yml and checks.yml configuration files:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1peahyfby51oowk8rr1x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1peahyfby51oowk8rr1x.png" alt="groups and checks" width="800" height="406"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  How System Checks Are Defined
&lt;/h3&gt;

&lt;p&gt;The 'hi' checks are literally any valid bash command line that can return a non-zero value.  If the command is successful, then the check is reported as positive.  However, because the bash command includes the ability to use pipes, you have an immense amount of control around how your checks are implemented.&lt;/p&gt;

&lt;p&gt;You can do a simple check to see if a process is running.  Lets say for example you wanted to check if the cups printing service is running on your host.  Normally the fastest way to check would be to execute a &lt;code&gt;ps -ef | grep cups&lt;/code&gt; on the command-line, like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;➤ ps -ef | grep cups
root      828443       1  0 Jun27 ?        00:00:00 /bin/sh /snap/cups/1058/scripts/run-cups-browsed
root      828451       1  0 Jun27 ?        00:00:00 /bin/sh /snap/cups/1058/scripts/run-cupsd
root      828648  828451  0 Jun27 ?        00:00:00 cupsd -f -s /var/snap/cups/common/etc/cups/cups-files.conf -c /var/snap/cups/common/etc/cups/cupsd.conf
root      828734  828443  0 Jun27 ?        00:00:00 /bin/sh /snap/cups/1058/scripts/run-cups-browsed
root     2458874       1  0 00:00 ?        00:00:00 /usr/sbin/cupsd -l
lp       2458875 2458874  0 00:00 ?        00:00:00 /usr/lib/cups/notifier/dbus dbus://
root     2458877       1  0 00:00 ?        00:00:00 /usr/sbin/cups-browsed
lp       2458897 2458874  0 00:00 ?        00:00:00 /usr/lib/cups/notifier/dbus dbus://
jbl      2539184 2453821  0 14:38 pts/5    00:00:00 grep --color=auto cups

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Looks like it's running!  But I don't want to have to issue that command every time I want to know if the service is running.  And lets be honest, it's kind of noisy, and not the prettiest thing to look at if all I want to know is if the service is running.&lt;/p&gt;

&lt;p&gt;Now with using 'hi', I can just use a similer &lt;code&gt;ps -ef | grep -E "[c]ups"&lt;/code&gt; command as part of a newly defined check in &lt;code&gt;config/checks.yml&lt;/code&gt;, as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  CUPS:
    info: CUPS print service
    group: Media
    command: |
      ps -ef | grep -E "[c]ups"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now when I run 'hi', I get a beautiful little indicator that tells me exactly what I want to know, amongst other information that might be important to me in general.&lt;/p&gt;

&lt;p&gt;Output showing CUPS service indicator:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsmikgl01hc1nfjnszb8i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsmikgl01hc1nfjnszb8i.png" alt="cups check" width="800" height="438"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For an exmaple of a more complex check, take a look at the one defined for ExpressVPN:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   ExpressVPN:
     info: For general privacy and security.
     group: Security
     command: |
       expressvpn status | grep -i connected | sed "s/\\x1b\\[[0-9;]*[mGK]//g"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the case of ExpressVPN, I don't just want to check if the process is running, but I'm interested in capturing a portion of the command output to be included in the 'hi' tool reporting. &lt;/p&gt;

&lt;p&gt;In order to leverage that output, there is a custom handler defined in &lt;code&gt;host_information.py&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;         elif 'expressvpn' in process.lower():    
             if re.search("Connected", output.strip()):    
                 output_messages.append(f"[✅] {process} Status: {output.strip()}")    
             else:    
                 output_messages.append(f"[❌] {process} Status: {output.strip()}")  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Instrumenting 'sub-checks'
&lt;/h3&gt;

&lt;p&gt;You can now define multiple sub-checks using the same check declaration pattern.&lt;/p&gt;

&lt;p&gt;Here's an example of how sub-checks are configured. We will use the 'Thunderbird' check which comes pre-defined in config/checks.yml.&lt;/p&gt;

&lt;p&gt;In the following check defined for Thunderbird, you can see that not only is the main check for the running process in place, but there are also two sub-checks defined for checking Thunderbird's 'Memory Usage' and 'Version' information.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  Thunderbird:
    info: My favorite mail client
    group: Communications
    indicators:
      positive:
        status:
        icon: 📧
      negative:
        status:
        icon: 📧
    command: |
      ps -ef | grep -E "[t]hunderbird"
    sub_checks:
      Memory Usage:
        command: |
          ps --no-headers -o rss -C thunderbird | awk '{sum+=$1} END {printf "%.2f MB (%.2f GB)\n", sum/1024, sum/1048576}'
        indicators:
          positive:
              icon: 💾
          negative:
              icon: 💾
      Version:
        command: |
          thunderbird --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Custom Indicators
&lt;/h3&gt;

&lt;p&gt;In the above Thunderbird check configuration example, you can also see the custom indicators which can be defined within the config/checks.yml file.&lt;/p&gt;

&lt;p&gt;These custom indicators, when defined, will override the default 'hi' check indicators (in most cases).&lt;/p&gt;

&lt;p&gt;You can see that custom indicators have been defined not just for Thunderbird, but also for it's 'Memory Usage' sub-check. The 'Version' sub-check does not have any indicators defined, and so that sub-check will use the default indicators.&lt;br&gt;
The flexibility of the 'hi' tool's bash-based checks makes this fairly easy to implement.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;I have found using this tool to be an invaluable pleseant suprise, to both develop and to use.&lt;/p&gt;

&lt;p&gt;As I mentioned in my previous article, there are many tools out there that can do some excellent reporting on host services, including running processes, CPU utilization, and file system services.  &lt;/p&gt;

&lt;p&gt;However I've never come across such a tool that allowed me to customize the reporting, to show exactly what I wanted, and ONLY what I wanted - in a nice, organized, terminal-friendly way.  &lt;/p&gt;

&lt;p&gt;I plan to continue development on this tool as time permits.  To keep me motivated and focused, I've added a &lt;a href="https://github.com/jbobbylopez/hi/blob/main/ROADMAP.md" rel="noopener noreferrer"&gt;ROADMAP.md&lt;/a&gt; file to the repository that highlights some ideas and upcoming features that I plan to explore and implement.&lt;/p&gt;

&lt;p&gt;I hope you find it a joy to use as much as I do.  If you want to hear more about 'hi', visit my website &lt;a href="https://thedevopsjoint.com/" rel="noopener noreferrer"&gt;The DevOps Joint&lt;/a&gt;, or connect with me on &lt;a href="https://www.linkedin.com/in/jbobbylopez/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;, or &lt;a href="https://x.com/jbobbylopez" rel="noopener noreferrer"&gt;@jbobbylopez&lt;/a&gt; on X.com.&lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;

</description>
      <category>linux</category>
      <category>terminal</category>
      <category>monitoring</category>
      <category>cli</category>
    </item>
  </channel>
</rss>
