# ndtool

A modern, extensible tool for managing Netdata installation, uninstallation, alerts, etc.

[![npm version](https://img.shields.io/npm/v/ndtool.svg)](https://www.npmjs.com/package/ndtool)

## Features

- Automated Netdata installation and configuration
- Easy setup for config change alerts (UFW, SSH, and more)
- Email notification configuration
- Extensible: add new config change alerts with minimal code

## Prerequisites

- [Node.js](https://nodejs.org/) (see `.nvmrc` for recommended version)
- [npm](https://www.npmjs.com/) (comes with Node.js)
- Netdata (installed by this tool or manually)
- [nvm](https://github.com/nvm-sh/nvm) (optional, for managing Node.js versions)

## Installation

### From npm (recommended)

You can install ndtool globally:

```bash
npm install -g ndtool
```

### From source

Clone the repository and install dependencies:

```bash
nvm use # if using nvm
npm install
```

## Usage

### Run the CLI

```bash
ndtool <command>
```

Or, from source (development):

```bash
npx ts-node bin/ndtool.ts <command>
```

### Install Netdata

```bash
ndtool install
```

### Add an Alert

```bash
ndtool add-alert
```

#### Supported Alerts

- **UFW Config Change**: Monitors changes in UFW rules/status
- **SSH Config Change**: Monitors changes to `/etc/ssh/sshd_config`

### Uninstall Netdata

```bash
ndtool uninstall
```

## Configuration

Configuration is auto-generated and stored in `~/.ndtoolrc`.
