Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
# Database files
*.db*
*.json
!examples/*

# Visual Studio
build
build
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
This is a Mikrotik The Dude database exporter. Pulls the database from your Mikrotik device loads the contents and saves the contents into a json file.

## Why
There's no support from Mikrotik to access this data easily. Either by API, CLI or the dude itself. The most useful tool Mikrotik provides is to export to csv which omits a lot data. More importantly the object index. Which is used to easily identify a device from the database.
There's no support from Mikrotik to access this data easily. Either by API, CLI or the dude itself. The most useful tool Mikrotik provides is to export to csv which omits a lot of data. More importantly the object index. Which is used to easily identify a device from the database.

The Dude database uses SQLite. But all the objects are stored in a proprietary binary blob rendering useless for querying any kind of info out of the database. This program parses every single binary blob into a well defined structure with field names.

Expand All @@ -18,7 +18,7 @@ Usage: the_dude_to_human.exe [options] <filename>
-f, --file Load the specified database file
-o, --out Save json database file
-c, --credentials Save credentials in plain text
-m, --mikrotik=user:password@address:port Connect to the specified mikrotik device
-m, --mikrotik user:password@address:port Connect to the specified mikrotik device
-h, --help Display this help and exit
-v, --version Print tool version

Expand All @@ -30,11 +30,17 @@ Address format examples:
user:@192.168.1.1 Hidden user defined password
```
## Example
From database file
```bash
./the_dude_to_human -f dude.db -o dude.json
./the_dude_to_human -f BasicDudeMonitoring.db -o BasicDudeMonitoring.json
```

Expected output
From Dude server. This will briefly stop the server while exporting the database.
```bash
./the_dude_to_human -m admin:@192.168.1.1 -o BasicDudeMonitoring.json
```

Expected output -> [BasicDudeMonitoring.json](examples/BasicDudeMonitoring.json)

```json
{
Expand Down Expand Up @@ -84,4 +90,4 @@ cmake --build build --target the_dude_to_human
* Export into other formats sql, sqlite, csv, etc.
* Repair database corruption with minimal data loss
* Clean database. Reduce size by removing unused objects and polling data.
* Compact database. Overtime objects id get too large leading to integer overflows. This should reorganize settings to keep the database in good shape.
* Compact database. Overtime objects id get too large leading to integer overflows. This should reorganize the entries to keep the database in good shape.
Binary file added examples/BasicDudeMonitoring.db
Binary file not shown.
300 changes: 300 additions & 0 deletions examples/BasicDudeMonitoring.json

Large diffs are not rendered by default.

Binary file added examples/BasicDudeMonitoring.sql.db
Binary file not shown.
Binary file added examples/NewDudeDatabase.db
Binary file not shown.
272 changes: 272 additions & 0 deletions examples/NewDudeDatabase.json

Large diffs are not rendered by default.

Binary file added examples/NewDudeDatabase.sql.db
Binary file not shown.
2 changes: 1 addition & 1 deletion src/the_dude_to_human/TheDudeToHuman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "the_dude_to_human/mikrotik/mikrotik_device.h"

static void PrintVersion() {
std::cout << "the dude to human version 1.0.0\n";
std::cout << "the dude to human version 1.1.0\n";
}

static void PrintHelp(const char* argv0) {
Expand Down
Loading