Coder Social home page Coder Social logo

chronos's Introduction

Chronos

When you develop plugins to monitoring your Windows enviroment, in some cases it is impossible to cache the plugin execution.

But, what you can do if some plugin cannot be executed twice in same hour, or even in the same day? Still, you cannot discard this specific monitoring plugin?

Chronos is a software used as a cache layer to store the last result from a software/plugin/script execution for a specified time.

If execution time exceeded defined 'timeout', Chronos will terminate plugin execution.

Stored cache data will be allocated on current execution directory.

Example:

C:\>SomeApp\Chronos.exe [params]
   ^
   └─── cache will be created in C:\Cache

C:\SomeApp>Chronos.exe [params]
          ^
          └─── cache will be created in C:\SomeApp\Cache

Executing scripts

Chronos works fine with executables (.exe files), but in case you have to execute scripts (such as powershell), you can omit initial parameters, (such as "powershell.exe -file")

Extension/Executor mapping:

Extension Executor Intial Params
.ps1 \WindowsPowerShell\v1.0\powershell.exe -File
.vbs \cscript.exe //NoLogo
.wsf \WScript.exe

the "Executor" will always use "Environment.SystemDirectory" as path suffix

Params explanation:

Chronos.exe 30 10 C:\Windows\System32\cmd.exe /c dir
            ^  ^  ^                           ^    ^
            │  |  └ plugin             plugin └──┬─┘
            │  └─── cache time         params ───┘
            └────── timeout

Chronos.exe clearCache
            ^        ^
            └────┬───┘
                 └─── clear all Chronos cache

Using examples:

Timeout: 60 seconds, keepping cache: 5 minutes

Chronos.exe 60 5 C:\monitoring\check_http.ps1 http://www.google.com

Timeout: 30 seconds, keepping cache: 6 hours

Chronos.exe 30 360 C:\monitoring\check_uptime.vbs 50 60

Clear chronos cache:

Chronos.exe clearCache

Obs.: Take some atention at arch used (x86, x64) when compiling Chronos. Chronos will use the same compiled architecture to execute plugins, so if you want to call "powershell" as x64, you MUST compile chronos as x64 Some plugins doesn't work without correct architecture, you can use Chronos to trick Operating System and force execution in a choosen arch.

chronos's People

Contributors

daniloalsilva avatar

Watchers

James Cloos avatar  avatar

chronos's Issues

Use a custom cache path

Chronos uses always a default cache path.

When an external call executes Chronos (through CMD, Powershell), the calling path became "C:\Windows\system32", which forces Chronos to create a folder "Cache" in ""C:\Windows\System32\Cache".

2 things must be improved:

  • Cache must be customizable via parameters
  • Relative path must be considered (from chronos, not the script caller path)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.