Comments (13)
I added that feature as mentioned above.
I haven't much test yet. π
It is vhost_traffic_status_dump
directive as follows:
http {
vhost_traffic_status_zone;
vhost_traffic_status_dump /var/log/nginx/vts.db;
...
server {
...
}
}
Please see the vhost_traffic_status_dump directive for detailed usage.
Latest commit: fc73722
from nginx-module-vts.
Thought π
I thought about achieving the aim outlined above and came to the following solution. I need your opinion regarding this.. I can record the desired data, if I am not wrong, by creating a small application (e.g. PHP script) that reads the JSON file (the status page url) every 5 minutes and stores the data in a MySQL database. The data structure might look like this:
month (08-2016) | domain (example.com) | sent (bytes) | received (bytes)
The script checks what month is it now and updates the affected month's row (taking account for domain name)
What do you think about this solution? Thanks :-)
from nginx-module-vts.
Thanks suggestion.
This module does not have that feature.
In other words, JSON data stored in memory is no method to update just now. (You know, to delete or reset is possible.)
I would consider to solve your suggestion. (e.g. /status/control?cmd=update
)
from nginx-module-vts.
@vozlt Thank you very much for the work put into this module. When it comes to updating, I meant updating an independent MySQL database table to store the statistical data in, not the module's data stored in memory. No need to update module's values, it should be enough to read the data and then store it somewhere else (a MySQL database for example). I have already achieved my goal with an outline like this:
MySQL database table:
main columns: zone (varchar), nginx main process start time (int - UNIX time-stamp), month (varchar like 08-2016) = these three columns should be defined as composite primary key. A small script (php, java..) reads the JSON data (provided by the module) every 1 minute and updates the MySQL table. That's all π
Additional columns: bytesIn, bytesOut updated on every reading (every minute).
The updating script can be scheduled to run using CRON.
from nginx-module-vts.
OK, thanks for detailed description.
from nginx-module-vts.
@acrolink - I wrote a collectd plugin for nginx_vts https://github.com/bobthemighty/collectd-vts - we send the metrics to riemann and then influx, but collectd also has a mysql output plugin, I think.
from nginx-module-vts.
hi @acrolink, can you share we us your PHP solution? I have the same problem. Thank you.
from nginx-module-vts.
@nottix .. Sure that should not be a problem.. I wrote it in c#/mono
not PHP. The working setup consists mainly of a statistics reading & storing executable and a small web app to display the data. The code is missing currently a vital mechanism which should detect the beginning of a new month and reset the counters accordingly.. I will fix that and make the full code available here within the next few days.
from nginx-module-vts.
Thank you ;-)
from nginx-module-vts.
Here you go:
https://github.com/acrolink/nginx-vts-records
I will add README in the next few days.. P.S. you need to install Mono
for Linux, get nuget.exe
, compile the executive (.exe) using Mono's xBuild
and schedule it to run using cron
..
from nginx-module-vts.
I'll try today, thank you ;-)
Il 09 set 2016 9:54 PM, "acrolink" [email protected] ha scritto:
@nottix https://github.com/nottix :-)
Here you go:
https://github.com/acrolink/nginx-vts-recordsI will add README in the next few days.. P.S. you need to install Mono
for Linux, get nuget.exe, compile the executive (.exe) using Mono's xBuild
and schedule it to run using cron..β
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#50 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAFiyRvucJ7RBugckY71V1bSoFvA7zXIks5qobmFgaJpZM4JeGl_
.
from nginx-module-vts.
I have just added .sql
to create DB structure.
from nginx-module-vts.
Perfect. Great work @vozlt thank you. I will happily test and report back in the near future.
from nginx-module-vts.
Related Issues (20)
- Sorting HOT 1
- Change defoult sorting. HOT 1
- buffer size may be too small HOT 2
- Release a new version HOT 2
- No such file or directoryodule-vts/config: line 2: auto/have HOT 2
- Label metrics with jsonrpc method HOT 16
- the status of server is not current when max_fails = 0 HOT 4
- /status/format/json not served after clean installation HOT 1
- VTS doesn't support query string encoding HOT 1
- I encountered the following Syntax error while compiling the vts source code in windows environment HOT 2
- [emerg] 1#1: module "/etc/nginx/modules/ngx_http_vhost_traffic_status_module.so" version 1022001 instead of 1025002 in /etc/nginx/nginx.conf:5 HOT 1
- periodic cleanup of shared memoryοΌ HOT 2
- Evaluate using Profile-Guided Optimization (PGO) and Post-Link Optimization (PLO) on VTS HOT 3
- Question - time window of statistics HOT 1
- Module bug HOT 4
- Will the request fail? 'ngx_slab_alloc() failed: no memory in vhost_traffic_status_zone' HOT 1
- 2024 Can this tool support TCP monitor? HOT 1
- shm_add_upstream error HOT 1
- how to disable upstream statistics collection? HOT 4
- bug: absolute URL prevent the use of a reverse proxy with a different path in front of the stats
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nginx-module-vts.