Giter Club home page Giter Club logo

nattrmon's Introduction

OpenAF

Build and Test asserts tests

Installing

Operating system install

On an empty folder:

OS Command/Instructions
Windows Download and execute:
https://openaf.io/win64/install.bat
Mac Execute on a Terminal:
wget -O - https://openaf.io/mac64/install.sh | sh
Unix x86 Execute on a shell:
wget -O - https://openaf.io/unix64/install.sh | sh
Unix arm32 Execute on a shell:
wget -O - https://openaf.io/arm32/install.sh | sh
Unix arm64 Execute on a shell:
wget -O - https://openaf.io/arm64/install.sh | sh

Docker container

Use the docker container:

docker run -ti openaf/openaf

(see more in openaf-dockers)

Download JAR file

Download just the Java JAR file:

Build URL
Latest stable build https://openaf.io/openaf.jar
Latest nightly build https://openaf.io/nightly/openaf.jar

and the execute on an empty folder:

java -jar openaf.jar --install

Minimum requirements

  • Java: JRE 1.8
  • Memory: 128MB (for installing and updating, runtime can be lower)
  • Storage: around 160MB (for installing and updating, runtime can be 64MB)

(storage requirements can be made lower if needed, tbc)

How to run a script

How to run a "Hello World" script

Step Instruction Sample
1 Create a "hello.js" file print("Hello World!");
2 Execute on the same folder as the "hello.js" file $ openaf -f hello.js

How to run in-line code

Windows

PS > openaf -c "print('Hello World!');"

Unix

$ openaf -c 'print("Hello World!");'

Update and uninstall

Update

openaf --update

Uninstall

Just delete the original empty folder where you executed the install command.

Documentation

Building

After cloning the repository locally execute:

ojob build.yaml

Testing a build

After building, on the tests sub-folder, the recommend way is to use the just openaf just built:

ojob autoTestAll.yaml

But you can use a previous stable openaf build if the ow.test and ojob functionality could be broken by your changes.

Links

nattrmon's People

Contributors

abrizida avatar github-actions[bot] avatar leandrofernandes5 avatar nmaguiar avatar nmsaguiar avatar pilhas avatar suryakalyan403 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nattrmon's Issues

Stuck detection on plugs with timeInterval and cron

If a plug has a timeInterval and also a cron entry the thread stuck detection mechanism only considers the timeInterval and will automatically restart nAttrMon if the expression on the cron provides a large time interval.

Backup specific configuration

Be able to produce a backup file with the specific configuration (all active and inactive plugs). This could even go further to commit to SVN/GIT directly.

Plugs description and doc plug in YAML/JSON

Enable the use of an extra description field for a more verbose description of the objective of each plug plus convert the attribute description javascript input plug (that is no longer working properly) into a reusable object that adds description to the defined objects upon attributes channel subscribe trigger.

Option to redirect log to stdout

Option to redirect the log to stdout (without creating the log folder and rotating files). This would be useful for docker containers.

In some inputs the property "name" is being added to values also

In some inputs the property "name" is also being added to attribute values. Doesn't seem to affect all attributes (for example semaphores are okay). Not yet sure if it's related with configuration or base code.
It's not a critical problem but rather annoying.

Channel based trigger

Some Outputs and Validations could subscribe the Attribute values and Warnings channels. This way they wouldn't need a timeInterval or cron to execute and would be event driven. On the other hand this might only be the intended behaviour in some cases (notably for warnings).

nOutput_ElasticSearch

Some nAttrMon implementations are "mirroring" the attribute values and warnings channels in ElasticSearch thus a generic nOutput_ElasticSearch is in order.

nOutput_H2: improved rotating housekeeping

The current implementation uses a time based rotating housekeeping. But some attributes are best suited for a number of events based rotating housekeeping. Plus it should be possible to configure, per attribute, specific retention periods based on number of events of time.

p.s. This should apply also to nOutput_Oracle

Input plugs: merge option

A new option could be added to input plugs to merge the attribute with the existing attribute value by a key.

For example: the attribute "Audit DBs" could be the result of merging "Audit A", "Audit B" and "Audit C".
If each audit is a map composed of, for example:

[{
   "DB": "B",
   "Username": "xpto1",
   "LastLogin": "2018-01-01T01:02:03.123Z"
},
{
   "DB": "B",
   "Username": "xpto2",
   "LastLogin": "2018-01-01T01:05:03.123Z"
}
]

The end attribute "Audit DBs" has all the merged arrays of Audit A, B and C. Each time the individual audit input plug executes it replaces all entries from the provided key (with channel getSet).

"Mute" plugs

There are some plugs, notably Output plugs, that are trigger by external events (like HTTP queries). So there isn't a need to update the internal plug info at a constant rate but rather they should query the internal channels for the requested info. Therefore some plugs could initialize but don't need to be executed every x time.

nOutput_ES: provide field indexes to easier use in ES

Each attribute value is sent to ES like:

{
   "name_of_attribute": {
      "key1": "value1",
      "property2": "value2",
      "property3": "value3"
   },
   "stamp_key": "value_key"
}

but to filter by key1, that might be used in other attributes, several specific filters might be needed. If an execArg is added to provide a list of key field indexes (in this case [ "key1" ]) the resulting value sent to ES would be:

{
   "name_of_attribute": {
      "property2": "value2",
      "property3": "value3"
   },
   "key1": "value1",
   "stamp_key": "value_key"
}

Create new Object nInput_RaidSessionsCount

Create a new Input object that displays the number of RAID sessions by user,
the total of active sessions and also the sessions peak.

The idea is to have a quick way of knowing if we have to many RAID sessions open and also how many for a specific user.

ElasticSearch Weekly index

For better or more flexible ,index management on ElasticSearch , a feature that enables us to choose to use a daily , weekly and maybe monthly index creation.

Review all config/objects

Review all config/objects to ensure all accept a single map argument (and add documentation):

  • nInput_AFPing
  • nInput_CBPMSemaphores
  • nInput_DB
  • nInput_FMSRuleStatus
  • nInput_Filesystem
  • nInput_FilesystemCount
  • nInput_IMMemory
  • nInput_LogErrorAgg
  • nInput_OSInfo
  • nInput_RAIDMemory
  • nInput_RunningFlows
  • nInput_Semaphores
  • nInput_Sessions
  • nInput_Shell
  • nOutput_Channels
  • nOutput_EmailWarnings
  • nOutput_H2
  • nOutput_HTTP
  • nOutput_HTTP_JSON
  • nOutput_Log
  • nOutput_Oracle
  • nOutput_Stdout
  • nValidation_AFPing
  • nValidation_Semaphores
  • nValidation_Yellows

Input to test a SFTP connection

Build an input to test the reach-ability of a SFTP server and check a list of folders. The attribute could have the total time of testing for compare results across time plus the result of testing each folder.

Warnings housekeeping

Warnings should get better housekeeping. A way to do it is to subscribe the channel with a function to clean closed warnings.

List of plugs

There should be a list or channel or similar with the list of active plugs (e.g. inputs, outputs. validations) for informative proposes.

nOutput_EmailWarnings

Change the line if(isUnDef(meta.chSubscribe) && meta.chSubscribe == "nattrmon::warnings")
to if(isUnDef(meta.chSubscribe) || !(meta.chSubscribe == "nattrmon::warnings"))

On startup snapshot values don't seem to be read

On startup of nattrmon.js all 4 main channels (Current Values, Last Values, Attributes and Warnings) don't seem to restore from the persisted corresponding snapshot files. Nevertheless their data is persisted on the snapshot files.

Change plugs return to add more than attributes

To allow for test/run operations on nOutput_Channels to retrieve more info from a plug execution other than just attributes the plug return should be changed to a map and dependencies changed accordingly. This would allow for the return of the warning objects created on validations, for example.

.nattrmonignore issue

Hello,

Having this file on .nattrmonignore :
/some/dir/config/inputs/anotherdir/a.input.pf.json
is leading to nattrmon ignoring all the inputs in the dir:
/some/dir/config/inputs/anotherdir/ instead of ignoring only a.input.pf.json in that dir.

Thanks in advance,
HD

Init plugs in YAML

There are new plugs for inputs, outputs and validations in YAML. A specific nInput_Init, nOutput_Init and nValidation_Init could be created in order to be possible to have init yamls which would easy configuration.

nInput_DB: Use templify for SQLs

Using templify for SQLs would allow for easy building of SQL query using the previous values, last date checked, last date modified, previous value modified date, etc.

Improve nValidation_Generic to aggregate warnings

Improve nValidation_Generic to aggregate multiple similar warnings if specified (e.g. add argument to provide a warning similarity >5%) to avoid generating hundreds of warnings if they are very similar.

Plug description in JSON

Plugs actually can be described in .YAML or they can be added programmatically with .JS. Some users prefer json to yaml when writing each plug description. So it would be nice on the .YAML plug reader to also be able to read *.json files.

nInput_Shell: cmd template

An improvement to nInput_Shell would be to allow to use a template for cmd (in cases the command arguments are based on other current attribute values)

Create new object nInput_Schedulers

Create new Input to display all schedulers.

Arguments:

  • status_include: receives an array of status to include (default: includes everything)
  • status_exclude: receives an array of status to include (default: excludes nothing)
  • name_exclude: receives an array of scheduler names to exclude (default: excludes nothing)

Columns to display:

  • Category

  • Name

  • Status

  • Next Execution Date

  • Last Execution Date

  • How Long Ago

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.