Skip to content

Commit 39482da

Browse files
committed
updating
1 parent 91463c7 commit 39482da

File tree

7 files changed

+686
-25
lines changed

7 files changed

+686
-25
lines changed

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# App and ide specific
1+
# prjx common ...
22
/etc/*.yml
33
/*.obj
44
/downloads/*
@@ -11,6 +11,8 @@
1111
.idea/
1212
/.idea/
1313
.idea/
14+
data/
15+
/stubs/
1416

1517
# Byte-compiled / optimized / DLL files
1618
__pycache__/
@@ -112,4 +114,4 @@ ENV/
112114
# mypy
113115
.mypy_cache/
114116

115-
/stubs/
117+

Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
## Build: docker build --force-rm --no-cache -t "qtool" .
2-
## Run Interactive: docker run -it qtool
3-
## Run Interactive: docker run -it qtool /bin/bash
4-
## Run Daemon: docker run -d qtool
1+
## Build: docker build --force-rm --no-cache -t "qasa" .
2+
## Run Interactive: docker run -it qasa
3+
## Run Interactive: docker run -it qasa /bin/bash
4+
## Run Daemon: docker run -d qasa
55
## apt-get install --reinstall ca-certificates
66

77
## Debian-base build...
88
FROM python:3.10.6-slim-buster
99
ADD . /app
1010
RUN pip install -r /app/requirements.txt
11-
CMD ["python3", "/app/qtool.py", "exec", "scheduler"]
11+
CMD ["python3", "/app/qasa.py", "exec", "scheduler"]
1212

1313
##
1414
### Alpine Linux build...
1515
# FROM python:3.10.6-alpine3.16
1616
# RUN set -ex && apk add --no-cache gcc libc-dev
1717
# ADD . /app
1818
# RUN pip install -r /app/requirements.txt
19-
# CMD ["python3", "/app/qtool.py", "exec", "scheduler"]
19+
# CMD ["python3", "/app/qasa.py", "exec", "scheduler"]
2020

2121

LICENSE.md

Lines changed: 661 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
[![Publish Docker image](https://github.com/projx/qtool/actions/workflows/build-and-push.yml/badge.svg)](https://github.com/projx/qtool/actions/workflows/build-and-push.yml)
1+
[![Publish Docker image](https://github.com/projx/qasa/actions/workflows/build-and-push.yml/badge.svg)](https://github.com/projx/qasa/actions/workflows/build-and-push.yml)
22

3-
# QtooL (Query Too Log)
3+
# QASA (Query Anything, Send Anywhere)
44

55
A poller for pulling useful data (SNMP, HTTP etc), and sending the results onwards... perhaps to a Log analytics system or syslog server... It really doesn't care!
66

@@ -14,7 +14,7 @@ Personally, I wanted to be able to visualise my homelab metrics, such as:
1414
- Internet connection speed-tests
1515
- Query certain Web APIs
1616

17-
Understandably, sane people use Grafana for this, it does it out-of-the-box... but I wanted the freedom of using something else, being able to easily point my data elsewhere, such as Splunk, ELK or even a Cloud service. So I wrote QtooL...
17+
Understandably, sane people use Grafana for this, it does it out-of-the-box... but I wanted the freedom of using something else, being able to easily point my data elsewhere, such as Splunk, ELK or even a Cloud service. So I wrote QASA...
1818

1919
## What is it?
2020

@@ -34,7 +34,7 @@ Some key requirements were
3434

3535
### There are 3 main components:
3636

37-
## ![connectors.png](https://github.com/projx/qtool/blob/main/docs/connectors.png?raw=true)
37+
## ![connectors.png](https://github.com/projx/qasa/blob/main/docs/connectors.png?raw=true)
3838

3939
The Scheduler creates a thread for each Poller, which runs the Poller > Formatter > Sender, then sleeps for a defined interval.
4040

@@ -84,13 +84,13 @@ Please see the [README.md](docs/index.md) for installation instructions.
8484
## Getting Started
8585

8686
There is a basic by working configuration (see etc-sample/) which polls yahoo.com and then writes the data to the log/ directory, also there are several examples for other pollers, such polling a Switch and WAP via SNMP.
87-
There is a sample configuration (see etc-sample/), it includes
8887

89-
Please see the [README.md](docs/index.md) for details on the configuration, and a breakdown of all the different options.
88+
Please see the [index.md](docs/index.md) for details on the configuration, and a breakdown of all the different options.
9089

9190
### **Possible Enhancements:**
9291

93-
1. Add "Content-Type" return to each Formatter class, i.e. json or text, for use in the senders
92+
1. Refactor Pollers, to make them easier for others to create new pollers or extend existing ones.
93+
2. Add "Content-Type" return to each Formatter class, i.e. json or text, for use in the senders
9494
2. Update FileSender to do file rotation
9595
3. Consider changing "time" field to "@timestamp"
9696
4. Pollers
@@ -121,6 +121,4 @@ Please see the [README.md](docs/index.md) for details on the configuration, and
121121

122122
---
123123

124-
I originally started writing this in summer of 2020, I've been using it in my homelab since beginning of 2021, and I intended to release to make it available last summer, but unfortunately life got in the way.
125-
126-
Now I've had an idea where I'd like to build a dashboard, something complimentary to Uptime Kuma, but monitoring SNMP etc, which will make use of QTool for polling, hence I've decided get it to a point I'm happy to make available for others to see.
124+
I started writing this in summer of 2020, I've personally been using it since then and making incremental changes. I never intended to open source it, but some users in r/homelab showed an interest, so I thought why not. You many find references to "QTool" in the code, this was its original name, but I was preparing for a trip to our casa in Spain at the time, and QASA seemed to have a better ring to it.

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
version: "3"
22
services:
3-
qtool:
4-
image: ghcr.io/projx/qtool:v0.1.5
5-
container_name: qtool
3+
qasa:
4+
image: ghcr.io/projx/qasa:v0.1.5
5+
container_name: qasa
66
restart: unless-stopped
77
volumes:
88
- ./etc/:/app/etc

etc-sample/senders.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
senders:
22

3-
## This will output to app/log/qtool_example.log
3+
## This will output to app/log/qasa_example.log
44
LOCALFILE:
55
connector_class: lib.senders.syslog.QFileSender
66
alias: LOCALFILE
77
directory: logs
8-
file: 'qtool_example.log'
8+
file: 'qasa_example.log'
99

1010
## You can make multiple senders of the same type, but they must have unique aliases.
1111
LOCALFILE_ALTERNATIVE:
1212
connector_class: lib.senders.syslog.QFileSender
1313
alias: LOCALFILE_ALTERNATIVE
1414
directory: logs
15-
file: 'qtool_example.log'
15+
file: 'qasa_example.log'
1616

1717
# SYSLOG_TCP:
1818
# alias: SPLUNK_SYSLOG_UDP

qasa.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def global_setup(show_output = True):
4848
@click.group()
4949
@click.option('-s', '--suppress', is_flag=True, default=False, help="Suppress most output (Note actual output level is defined in settings.yml")
5050
def main(suppress):
51-
"""QtooL - Is a scheduler for Polling, Formatting and Sending """
51+
"""QASA - Is a scheduler for Polling, Formatting and Sending """
5252

5353
# Handle flags
5454
show_output = False if suppress else True

0 commit comments

Comments
 (0)