<commit_before># Checkman

Checkman runs your custom script(s) periodically and then updates system tray icon.
It could be used to check on CI build status, check site response status, etc.

![](https://raw.github.com/cppforlife/checkman/master/screenshots/checkman.png)


# Installation

Install and open Checkman Mac app into `/Applications`
(backslash is for [overriding possible bash alias](http://en.wikipedia.org/wiki/Alias_(command\)#Overriding_aliases)):

    \curl https://raw.github.com/cppforlife/checkman/master/bin/install | bash -s

If you ever need to kill Checkman:

    killall Checkman


# Configuring Checkman via Checkfile(s)

* Configured via one or more files from `~/Checkman` directory.
  Checkfile example with 3 checks (very similar to Procfile):

    ```
    #- CI
    ci: jenkins_build.check https://ci:pwd@127.0.0.1 FancySite
    staging-deploy: jenkins_build.check https://ci:pwd@127.0.0.1 FancySiteDeploy

    #-
    staging-web: site.check http://fancysite.com
    ```

* Symlinks are resolved. Suggested approach is to have Checkfile with project
  specific checks in project directories and then symlink from `~/Checkman` directory.

* Config files are reloaded when changes are saved.

* Commands run relative to the containing checkfile.

* `#` can be used to comment.

* `#-` is used as a separator.

* `#- Some title` is used as a title separator.

* Works great with `tee` to keep check's history
  e.g. `site: site.check http://site.com | tee -a tmp/site.log`


# Included scripts

* `site.check <URL>` checks returned http response for 200 OK

* `vmc_apps.check <CC_TARGET_URL> <SPACE_ID> <APP_PREFIX>`
   checks that all apps are running

* `jenkins_build.check <JENKINS_URL> <JOB_NAME>`
  checks specific Jenkins build status

* `test.check <RESULT> <CHANGING>` returns predefined result/changing

* `airbrake.check <ACCOUNT_NAME> <API_TOKEN> <PROJECT_ID>`
  checks for recent errors


# Building custom checks

Each check is expected to return following JSON:

    {
      // Indicates whether check succeeded
      "result": <bool>,

      // Indicates whether result is in progress of being changed
      // e.g. CI build is in progress
      "changing": <bool>,
      
      // Url to open when check menu item is clicked
      "url": <string|null>,
      
      // List of additional details to show in the submenu
      "info": [
        [<string>, <string>] // Key-value pairs
      ]
    }

Check out included `scripts/` for examples.


## Debugging

Check's debugging window can be opened by `Option + click`-ing on its menu item.
Shown command/stderr/stdout will be updated as time passes.


# Custom user settings

Change default 10 sec run interval for all checks:

    defaults write com.tomato.Checkman checkRunInterval -int 20


# Todos

* Audit CPU/memory usage
* Run only single instance of the app
* Indicate when check info was last updated
* Find permanent status images<commit_msg>link to debugging tips wiki from readme<commit_after># Checkman

Checkman runs your custom script(s) periodically and then updates system tray icon.
It could be used to check on CI build status, check site response status, etc.

![](https://raw.github.com/cppforlife/checkman/master/screenshots/checkman.png)


# Installation

Install and open Checkman Mac app into `/Applications`
(backslash is for [overriding possible bash alias](http://en.wikipedia.org/wiki/Alias_(command\)#Overriding_aliases)):

    \curl https://raw.github.com/cppforlife/checkman/master/bin/install | bash -s

If you ever need to kill Checkman:

    killall Checkman


# Configuring Checkman via Checkfile(s)

* Configured via one or more files from `~/Checkman` directory.
  Checkfile example with 3 checks (very similar to Procfile):

    ```
    #- CI
    ci: jenkins_build.check https://ci:pwd@127.0.0.1 FancySite
    staging-deploy: jenkins_build.check https://ci:pwd@127.0.0.1 FancySiteDeploy

    #-
    staging-web: site.check http://fancysite.com
    ```

* Symlinks are resolved. Suggested approach is to have Checkfile with project
  specific checks in project directories and then symlink from `~/Checkman` directory.

* Config files are reloaded when changes are saved.

* Commands run relative to the containing checkfile.

* `#` can be used to comment.

* `#-` is used as a separator.

* `#- Some title` is used as a title separator.

* Works great with `tee` to keep check's history
  e.g. `site: site.check http://site.com | tee -a tmp/site.log`


# Included scripts

* `site.check <URL>` checks returned http response for 200 OK

* `vmc_apps.check <CC_TARGET_URL> <SPACE_ID> <APP_PREFIX>`
   checks that all apps are running

* `jenkins_build.check <JENKINS_URL> <JOB_NAME>`
  checks specific Jenkins build status

* `test.check <RESULT> <CHANGING>` returns predefined result/changing

* `airbrake.check <ACCOUNT_NAME> <API_TOKEN> <PROJECT_ID>`
  checks for recent errors


# Building custom checks

Each check is expected to return following JSON:

    {
      // Indicates whether check succeeded
      "result": <bool>,

      // Indicates whether result is in progress of being changed
      // e.g. CI build is in progress
      "changing": <bool>,
      
      // Url to open when check menu item is clicked
      "url": <string|null>,
      
      // List of additional details to show in the submenu
      "info": [
        [<string>, <string>] // Key-value pairs
      ]
    }

Check out included `scripts/` for examples.


## Debugging

Check's debugging window can be opened by `Option + click`-ing on its menu item.
Shown command/stderr/stdout will be updated as time passes. Refer to
[Debugging Tips](https://github.com/cppforlife/checkman/wiki/Debugging-Tips)
wiki page for more tips.


# Custom user settings

Change default 10 sec run interval for all checks:

    defaults write com.tomato.Checkman checkRunInterval -int 20


# Todos

* Audit CPU/memory usage
* Run only single instance of the app
* Indicate when check info was last updated
* Find permanent status images
{'fraction_non_alphanumeric': 0.09457441513190643, 'fraction_numerical': 0.00663680106188817, 'mean_word_length': 3.4421518054532054, 'pattern_counts': {'":': 8, '<': 35, '<?xml version=': 0, '>': 35, 'https://': 9, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '275186', 'n_tokens_mistral': 1896, 'n_tokens_neox': 1784, 'n_words': 680}