Metadata-Version: 2.4
Name: cmdbsyncer
Version: 4.0.2
Summary: Rule-based modular synchronizer for Checkmk, Netbox, Ansible, I-DOIT, Jira CMDB and 15+ other CMDB/monitoring systems
Author-email: Kuhn & Ruess GmbH <info@kuhn-ruess.de>
Maintainer-email: Bastian Kuhn <mail@bastian-kuhn.de>
License: MIT
Project-URL: Homepage, https://cmdbsyncer.de
Project-URL: Documentation, https://docs.cmdbsyncer.de
Project-URL: Repository, https://github.com/kuhn-ruess/cmdbsyncer
Project-URL: Issues, https://github.com/kuhn-ruess/cmdbsyncer/issues
Project-URL: Changelog, https://github.com/kuhn-ruess/cmdbsyncer/tree/main/changelog
Keywords: cmdb,checkmk,netbox,ansible,i-doit,jira,infrastructure,automation,synchronization,monitoring
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Flask
Classifier: Intended Audience :: System Administrators
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: System :: Systems Administration
Classifier: Topic :: System :: Monitoring
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Flask==3.1.3
Requires-Dist: joserfc==1.6.4
Requires-Dist: email_validator==2.2.0
Requires-Dist: Flask-Bootstrap4==4.0.2
Requires-Dist: Flask-Login==0.6.3
Requires-Dist: Flask-Mail==0.10.0
Requires-Dist: flask-mongoengine-3==1.1.0
Requires-Dist: flask-restx==1.3.0
Requires-Dist: Flask-WTF==1.2.2
Requires-Dist: pyotp==2.9.0
Requires-Dist: requests==2.33.1
Requires-Dist: rich==14.0.0
Requires-Dist: pynetbox==7.4.1
Requires-Dist: python-slugify==8.0.4
Requires-Dist: tablib==3.8.0
Requires-Dist: sortedcontainers==2.4.0
Requires-Dist: pyyml==0.0.2
Requires-Dist: Flask-Admin==2.0.2
Requires-Dist: pylint==4.0.5
Requires-Dist: Flask-Limiter==4.1.1
Provides-Extra: extras
Requires-Dist: python-ldap==3.4.4; extra == "extras"
Requires-Dist: markdown-it-py==3.0.0; extra == "extras"
Requires-Dist: pypyodbc==1.3.6; extra == "extras"
Requires-Dist: sqlserverport==1.0.1; extra == "extras"
Requires-Dist: mysql-connector-python==9.1.0; extra == "extras"
Requires-Dist: pyvim==3.0.3; extra == "extras"
Requires-Dist: pyvmomi==8.0.3.0.1; extra == "extras"
Requires-Dist: mcp==1.10.1; extra == "extras"
Provides-Extra: ansible
Requires-Dist: kerberos==1.3.1; extra == "ansible"
Requires-Dist: pykerberos==1.2.4; extra == "ansible"
Requires-Dist: pywinrm==0.4.3; extra == "ansible"
Requires-Dist: ntlm-auth==1.5.0; extra == "ansible"
Requires-Dist: ansible==10.5.0; extra == "ansible"
Dynamic: license-file

# CMDBsyncer

A rule-based and modular system to synchronize hosts between Checkmk, Netbox, and other systems. The main goal is the complete organization of hosts based on CMDB systems with flexible rules and automation.

## 🔗 Links

* [🌐 Homepage](https://cmdbsyncer.de)
* [📖 Documentation](https://docs.cmdbsyncer.de)
* [🚀 Releases & Versioning](RELEASE.md) — how to pick a stable version for production

## 📋 Table of Contents

- [Overview](#overview)
- [Features](#features)
- [Quick Start](#quick-start)
- [Supported Systems](#supported-systems)
- [Installation](#installation)
- [Main Functions](#main-functions)
- [Screenshots](#screenshots)
- [Contributing](#contributing)
- [License](#license)

## 🎯 Overview

CMDBsyncer is a powerful, web-based tool designed to solve the complex challenge of managing host inventories across multiple IT management systems. Whether you're synchronizing between Checkmk, Netbox, I-DOIT, or other platforms, CMDBsyncer provides a unified approach with rule-based automation.

### Key Benefits
- **Centralized Management**: Single interface for all your CMDB synchronization needs
- **Rule-Based Logic**: Flexible rules for host organization and attribute management
- **Multi-Platform**: Support for 15+ systems including Checkmk, Netbox, Ansible, and more
- **Scalable**: Tested with 140,000+ hosts
- **Secure**: Built-in authentication, 2FA, and encryption of sensitive data

## ⚡ Quick Start

Get started quickly using Docker Compose:

```bash
# Clone the repository
git clone https://github.com/your-username/cmdbsyncer.git
cd cmdbsyncer

# For production: check out the last released version.
# For testing the bleeding edge: stay on main.
git checkout stable

# Start the application
./helper up

# Access the container
./helper shell

# Create your first user
./helper create_user 'your-email@example.com'

# Access the web interface
# Open http://your-host:5003 in your browser
```

This runs a development version that you can use to test everything.

## 📸 Screenshots

![Rules Configuration](https://user-images.githubusercontent.com/899110/201333967-2d7f3f35-cc69-4cad-931f-1da096f94056.png)
*Rule-based synchronization configuration interface*

![Debug Options](https://user-images.githubusercontent.com/899110/201333725-d699d50f-a5eb-4539-a3af-3db3e0647ebb.png)
*Comprehensive debug and testing options*

## 🚀 Main Functions

### Core Features
- **🌐 Web Interface** - Complete web-based management with login, 2FA, and user management
- **⚙️ Configuration Management** - All configuration handled through the web interface (except initial installation)
- **🔌 Plugin API** - Simple API to integrate custom data sources
- **🐛 Debug Tools** - Various debug options available via the `./cmdbsyncer` command
- **🔐 Security** - Encryption of secrets and secure credential management
- **⏰ Scheduling** - Built-in cron management for automated synchronization
- **📊 Monitoring** - Integration with monitoring systems
- **🎯 Template Support** - Jinja2 templating for configuration and rules
- **🔄 REST API** - Full REST API for automation and integration
- **🤖 MCP Server** - Model Context Protocol server for Claude Desktop, Cursor, Cline & co. — expose hosts, accounts, rules and cron over `cmdbsyncer-mcp`

### Rule Engine
- **📝 Attribute Control** - Rules based on host attributes
- **✏️ Attribute Rewrites** - Dynamic modification of host attributes  
- **🔍 Filters** - Advanced filtering for hosts and attributes
- **⚡ Action Rules** - Automated actions in Ansible, Checkmk, Netbox, etc.

### Ansible Integration
- **📋 Inventory Source** - Use CMDBsyncer as dynamic Ansible inventory

## 🔧 Supported Systems

### Checkmk
**Complete lifecycle management for monitoring systems**

- ✅ **Host Management** - Full host lifecycle (creation, labels, folders, deletion, rules)
- 📈 **Scalability** - Tested with more than 140,000 hosts
- 🏷️ **Attribute Sync** - Sync and update all host attributes, tags, and labels
- ⚡ **Performance** - Full support of API bulk operations and multiprocessing
- 📁 **Folder Management** - Complete Checkmk folder management with pool features
- 👥 **Groups** - Creation of host, contact, and service groups
- 🎯 **Tags** - Create host tags and host tag groups
- 📊 **BI Integration** - Create BI aggregations
- 📋 **Rules** - Create all types of setup rules
- 🔄 **Updates** - Smart update controls to prevent excessive changes
- 🤖 **Agents** - Commands to activate configuration, bake and sign agents
- 👤 **User Management** - Manage Checkmk users (create/delete/reset password)
- 📦 **Inventory** - Host attributes inventory for Ansible integration
- 🔐 **Password Store** - Create and manage encrypted password entries
- 🎯 **DCD Rules** - Create Data Collection Rules
- 🔍 **Version Detection** - Automatic Checkmk version detection for correct API usage

### Ansible
**Automation and configuration management**

- 📋 **Inventory** - Rule-based inventory source
- 🖥️ **Agent Management** - Complete Checkmk agent management (Linux & Windows)
  - Installation and TLS registration
  - Bakery registration
- 🏗️ **Site Management** - OMD site management (updates, creation)
  - Automatic Checkmk version downloads

### Netbox
**Network infrastructure management**

- 🔄 **Bidirectional Sync** - Rule-based export and import of devices and VMs
- 🏗️ **Auto-Creation** - Automatic category creation
- 🗺️ **Infrastructure** - Export sites, interfaces, IPAM data
- 👥 **Contacts** - Contact management
- 📍 **Location Management** - Comprehensive location handling

### I-DOIT
**IT documentation and CMDB**

- 📊 **Template-Based** - Rule-based export and import using templates
- 🔄 **Bidirectional** - Full import/export capabilities

### Other Integrations

#### **PRTG** - Network monitoring
- 📥 **Object Import** - Import monitoring objects to sync with Checkmk

#### **BMC Remedy** - IT Service Management  
- 📊 **Limited Import** - Basic import functionality

#### **Cisco DNA** - Network management
- 🌐 **Device Import** - Import devices and interface information

#### **CSV Files** - Data management
- 📄 **Host Management** - Manage hosts based on CSV files
- ➕ **Data Enhancement** - Add additional information from CSV files

#### **LDAP** - Directory services
- 👥 **Object Import** - Import objects from LDAP directories

#### **REST APIs** - Custom integrations
- 🔌 **Custom APIs** - Import from custom REST API endpoints

#### **JSON** - File-based data
- 📄 **File Import** - Import JSON file structures

#### **Jira CMDB** - Atlassian integration
- ☁️ **Cloud & On-Prem** - Support for both deployment types
- 📥 **Object Import** - Import CMDB objects

#### **JDISC** - Network discovery
- 🔍 **Discovery Import** - Import discovered objects

#### **VMware** - Virtualization
- 📊 **Attribute Management** - Import and export VM attributes
- 🔄 **Bidirectional** - Full import/export to VMware VMs

#### **Database Systems**
- **MySQL** - Import and inventory database tables
- **MSSQL/FreeTDS/ODBC** - Support for all ODBC-based database connections

## 🛠️ Installation

### Prerequisites
- Docker and Docker Compose
- Python 3.11+ (for development)
- Web browser (for the management interface)

### Production Installation

1. **Clone the repository and pick a version**
   ```bash
   git clone https://github.com/your-username/cmdbsyncer.git
   cd cmdbsyncer

   # Use the stable branch (last released version) for production:
   git checkout stable
   # …or pin to a specific release tag for reproducible deployments:
   # git checkout v3.12.12
   ```
   See [RELEASE.md](RELEASE.md) for the full branching/versioning policy.

2. **Configure environment**
   ```bash
   # Copy and edit configuration files
   cp docker-compose.prod.yml docker-compose.yml
   # Edit the configuration as needed
   ```

3. **Start the application**
   ```bash
   docker-compose up -d
   ```

4. **Create admin user**
   ```bash
   ./helper create_user 'admin@your-domain.com'
   ```

### Development Installation

For development and testing purposes:

```bash
# Start development environment
./helper up

# Access container shell
./helper shell

# Create test user  
./helper create_user 'test@example.com'

# Access at http://localhost:5003
```

### MCP (Model Context Protocol)

CMDBsyncer ships an MCP server that lets LLM clients (Claude Desktop, Cursor,
Cline, …) read and write syncer state directly. It boots in CLI mode (no web
stack) and authenticates with HTTP Basic; access is gated by the `mcp`
`api_role` on the user. SSE/HTTP transport authenticates **per request** and
requires HTTPS (mirrors the REST API's gate).

```bash
# 1. Install the MCP SDK — ships in the [extras] pip extra
pip install 'cmdbsyncer[extras]'

# 2. Run the server — usually configured into your MCP client, but you can
#    also pipe it manually:
cmdbsyncer-mcp --user admin@your-domain.com --password '****'

# 3. Or pass credentials via env vars (handy for client config):
export CMDBSYNCER_API_USER=admin@your-domain.com
export CMDBSYNCER_API_PASSWORD='****'
cmdbsyncer-mcp
```

Example `claude_desktop_config.json` snippet:

```json
{
  "mcpServers": {
    "cmdbsyncer": {
      "command": "cmdbsyncer-mcp",
      "env": {
        "CMDBSYNCER_API_USER": "admin@your-domain.com",
        "CMDBSYNCER_API_PASSWORD": "****"
      }
    }
  }
}
```

**Inside Docker** the server is preinstalled — set `MCPSERVER_ENABLED=1`
(optionally `MCPSERVER_PORT=8765`) in your compose file and the container
entrypoint starts the SSE listener for you. Map port 8765 if you want to
expose it. Per-request Basic Auth applies the same way.

Tools exposed: host CRUD, inventory write, account read, rule export/import,
autorules trigger, cron status & trigger, log read. See
[docs.cmdbsyncer.de — MCP](https://docs.cmdbsyncer.de) for the full catalog.

## 📋 Requirements

### System Requirements
- **Memory**: Minimum 2GB RAM, recommended 4GB+
- **Storage**: Minimum 10GB free space
- **Network**: HTTPS access to target systems (Checkmk, Netbox, etc.)

### Supported Target Systems
- **Checkmk**: All current versions (automatic detection)
- **Netbox**: v2.8+ 
- **Ansible**: v2.9+
- **I-DOIT**: v1.12+
- **And many more** - see [full compatibility matrix](https://docs.cmdbsyncer.de)

## 🤝 Contributing

We welcome contributions! Please follow these steps:

1. **Fork the repository**
2. **Create a feature branch** (`git checkout -b feature/amazing-feature`)
3. **Commit your changes** (`git commit -m 'Add amazing feature'`)
4. **Push to the branch** (`git push origin feature/amazing-feature`)
5. **Open a Pull Request**

### Development Guidelines
- Follow existing code style
- Add tests for new features
- Update documentation as needed
- Test with multiple target systems

### Git Hooks

The repository ships a `pre-commit` hook in `.githooks/` that refreshes
`application/buildinfo.txt`, runs pylint on staged Python files, and executes
the unit-test suite before each commit. Activate it once per clone:

```bash
git config core.hooksPath .githooks
```

## 📄 License

This project is licensed under the [MIT License](LICENSE) - see the LICENSE file for details.

## 🆘 Support

- 📖 **Documentation**: [docs.cmdbsyncer.de](https://docs.cmdbsyncer.de)
- 🌐 **Homepage**: [cmdbsyncer.de](https://cmdbsyncer.de)  
- 🐛 **Issues**: [GitHub Issues](https://github.com/kuhn-ruess/cmdbsyncer/issues)
- 💬 **Discussions**: [GitHub Discussions](https://github.com/kuhn-ruess/cmdbsyncer/discussions)

---

⭐ **If you find this project helpful, please give it a star!** ⭐
