ralfonso-directnic / cpanel_exporter Goto Github PK
View Code? Open in Web Editor NEWcPanel Metrics Exporter
cPanel Metrics Exporter
This project looks useful, but please add a license so people can fork, modify it, and fix it.
However, without a license, the default copyright laws apply, meaning that you retain all rights to your source code and no one may reproduce, distribute, or create derivative works from your work.
Hi;
Thank you so much for the awesome cPanel exporter. I have found an issue where the values for cpanel_quota_used and cpanel_quota_percent are always zero. I have tested on 3 different servers and those values are never larger than zero.
The following error is also observed in logs
fetch.go:123: error: json: cannot unmarshal number into Go struct field .result.data.megabytes_used of type string
fetch.go:123: error: json: cannot unmarshal number into Go struct field .result.data.megabyte_limit of type string
I'm not familiar with Go and cannot help with fixing the issue, but I think the issue is caused by how cPanel UAPI returns data. I have noticed that the JSON response for the call /usr/bin/uapi --user=username --output=json Quota get_quota_info
sometimes includes floats and sometimes string for the values of megabyte_limit
and megabytes_remain
depending on whether the package is configured with Unlimited quota or not.
Here are some sample relevant values from real accounts
"megabyte_limit":"0.00", "megabytes_remain":"0.00", "megabytes_used":53.92
"megabyte_limit":"0.00", "megabytes_remain":"0.00", "megabytes_used":3.05,
"megabyte_limit":"0.00", "megabytes_remain":"0.00", "megabytes_used":18.57
"megabyte_limit":2000, "megabytes_remain":1996.43, "megabytes_used":3.57
"megabyte_limit":4000, "megabytes_remain":3975.55, "megabytes_used":24.45
I hope you find this helpful.
Started seeing that cpanel exporter keeps crashing with segmentation fault. This is happening on random servers.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x7f2fab]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.