n27051538 / solaris_exporter Goto Github PK
View Code? Open in Web Editor NEWSPARC solaris exporter for Prometheus
License: MIT License
SPARC solaris exporter for Prometheus
License: MIT License
The username and groupname prometheus
used in install script are too long on solaris 10 to install the exporter as SMF service.
To make installation work, i'm oblige to rename username and groupname to max 8 characters name in solaris_exporter_smf.sh
and solaris_exporter_role.sh
.
pkgadd
not support user
and password
in proxy environement variable http_proxy and https_proxy.
you must download pkgutil
package with wget/curl before.
# export http_proxy=http://<user>:<password>@proxy.example.com:3128
# export https_proxy=https://<user>:<password>@proxy.example.com:3128
# wget http://get.opencsw.org/now
# pkgadd -d ./now
The last pkgutil
work fine with this proxy variable syntax, you can do csw pkg install with it.
I've installed everything as described in readme. No issues found during packages installation. However when I try to run exporter, I get following error:
bash-3.2# /opt/csw/bin/python2.7 solaris_exporter.py
Traceback (most recent call last):
File "solaris_exporter.py", line 1039, in <module>
REGISTRY.register(c)
File "/opt/csw/lib/python2.7/site-packages/prometheus_client/registry.py", line 26, in register
names = self._get_names(collector)
File "/opt/csw/lib/python2.7/site-packages/prometheus_client/registry.py", line 66, in _get_names
for metric in desc_func():
File "solaris_exporter.py", line 440, in collect
swap = psutil.swap_memory()
File "/opt/csw/lib/python2.7/site-packages/psutil/__init__.py", line 1982, in swap_memory
return _psplatform.swap_memory()
File "/opt/csw/lib/python2.7/site-packages/psutil/_pssunos.py", line 158, in swap_memory
t, f = line[3:4]
ValueError: need more than 1 value to unpack
bash-3.2# cat /etc/release
Oracle Solaris 10 1/13 s10x_u11wos_24a X86
Copyright (c) 1983, 2013, Oracle and/or its affiliates. All rights reserved.
Assembled 17 January 2013
bash-3.2# uname -a
SunOS myhost.com 5.10 Generic_147148-26 i86pc i386 i86pc
Hi
Look like solaris_exporter_per_zone_usage_total didn't collect only I see some metrics for zones as below.
solaris_exporter_per_zone_caps_errors_created
solaris_exporter_per_zone_caps_errors_total
solaris_exporter_per_zone_caps_processing
solaris_exporter_per_zone_caps_timeouts_created
solaris_exporter_per_zone_caps_timeouts_total
solaris_exporter_per_zone_caps_tota
lsolaris_exporter_per_zone_cpu_errors_created
solaris_exporter_per_zone_cpu_errors_total
solaris_exporter_per_zone_cpu_processing
solaris_exporter_per_zone_cpu_timeouts_created
solaris_exporter_per_zone_cpu_timeouts_total
# TYPE solaris_exporter_cpu_time_processing gauge
solaris_exporter_cpu_time_processing 0.01242818683385849
# HELP solaris_exporter_per_zone_usage_total kstat counters
# TYPE solaris_exporter_per_zone_usage_total counter
# HELP solaris_exporter_MemCollector_processing Time spent processing request
# TYPE solaris_exporter_MemCollector_processing gauge
solaris_exporter_MemCollector_processing 0.028274312615394592
-
How to collect other metrics for zone?
OS: Oracle Solaris 11.3.36.24.0
HW: Sparc T7
followed all the instructions but when I tryied to launch solaris_exporter by
python2.7 solaris_exporter.py
Traceback (most recent call last):
File "solaris_exporter.py", line 133, in
from prometheus_client.core import REGISTRY, Counter, Gauge, GaugeMetricFamily, CounterMetricFamily, UntypedMetricFamily
File "/usr/lib/python2.7/site-packages/prometheus_client/init.py", line 3, in
from . import (
File "/usr/lib/python2.7/site-packages/prometheus_client/exposition.py", line 113
def make_wsgi_app(registry: CollectorRegistry = REGISTRY, disable_compression: bool = False) -> Callable:
^
SyntaxError: invalid syntax
root@solaris-test:/opt/solaris_exporter# uname -a
SunOS solaris-test 5.11 11.4.0.15.0 i86pc i386 i86pc
Can some one help me to get this running.
thanks
I had such high hopes..
Unfortunately needs a touch up to get up to date I expect.. Certainly python 2.7 is an issue at least...
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
I will have a dig around, but unlikely to get it sorted myself unfortunately
When executing pkg install pkg:/developer/gcc/gcc-c-5
Creating Plan (Solver setup): - pkg install: No matching version of developer/gcc/gcc-c-5 can be installed: Reject: pkg://solaris/developer/gcc/[email protected] Reason: No version for 'require' dependency on library/[email protected],5.11-0.175.3.0.0.30.0 can be found
Greetings, just letting you know that I have tested this on Openindiana (x86) (OI-hipster-minimal-20201031.iso) and it seems to work. I haven't gotten any errors or stack-traces anyways.
Hi,
I have run into a similar issue as seen previously by others with traceback errors when running solaris_exporter.py.
The errors seen are: -
admin@XXXXXX:/solaris_exporter$ python2 solaris_exporter.py/solaris_exporter$
couldn't set locale correctly
Traceback (most recent call last):
File "solaris_exporter.py", line 1040, in
REGISTRY.register(c)
File "/export/home/admin/.local/lib/python2.7/site-packages/prometheus_client/registry.py", line 26, in register
names = self._get_names(collector)
File "/export/home/admin/.local/lib/python2.7/site-packages/prometheus_client/registry.py", line 66, in _get_names
for metric in desc_func():
File "solaris_exporter.py", line 441, in collect
swap = psutil.swap_memory()
File "/export/home/admin/.local/lib/python2.7/site-packages/psutil/init.py", line 2000, in swap_memory
return _psplatform.swap_memory()
File "/export/home/admin/.local/lib/python2.7/site-packages/psutil/_pssunos.py", line 160, in swap_memory
free += int(int(f) * 512)
ValueError: invalid literal for int() with base 10: 'yes'
admin@XXXXXX:
In terms of the system I am trying to run this on, the following shows the environment and the installation process for the various components installed: -
admin@XXXXXX:$ cat /etc/release$ uname -a
Oracle Solaris 11.4 SPARC
Copyright (c) 1983, 2021, Oracle and/or its affiliates.
Assembled 15 December 2021
admin@XXXXXX:
SunOS XXXXXX 5.11 11.4.41.107.2 sun4v sparc sun4v non-virtualized
admin@XXXXXX:~$
admin@XXXXXX:$ export https_proxy=http://www-proxy.us.oracle.com:80$ python2 -m pip install prometheus_client
admin@XXXXXX:
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Defaulting to user installation because normal site-packages is not writeable
couldn't set locale correctly
Collecting prometheus_client
Downloading prometheus_client-0.12.0-py2.py3-none-any.whl (57 kB)
|################################| 57 kB 993 kB/s
Installing collected packages: prometheus-client
Successfully installed prometheus-client-0.12.0
admin@XXXXXX:~$ sudo pkg install pkg:/developer/gcc
Password:
Failed to set locale: unsupported locale setting. Falling back to C.
pkg: Unable to set locale 'en_GB.UTF-8'; locale package may be broken or
not installed. Reverting to C locale.
Packages to install: 19
Mediators to change: 2
Services to change: 1
Create boot environment: No
Create backup boot environment: No
DOWNLOAD PKGS FILES XFER (MB) SPEED
Completed 19/19 1974/1974 677.7/677.7 35.4M/s
PHASE ITEMS
Installing new actions 2553/2553
Updating package state database Done
Updating package cache 0/0
Updating image state Done
Creating fast lookup database Done
Updating package cache 1/1
admin@XXXXXX:$ which gcc$ sudo ln -s /usr/bin/gcc /usr/bin/cc
/usr/bin/gcc
admin@XXXXXX:
Password:
admin@XXXXXX:$ export CFLAGS=-m32$ python2 -m pip install psutil==5.7.0
admin@XXXXXX:
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Defaulting to user installation because normal site-packages is not writeable
couldn't set locale correctly
Collecting psutil==5.7.0
Downloading psutil-5.7.0.tar.gz (449 kB)
|################################| 449 kB 6.4 MB/s
Using legacy 'setup.py install' for psutil, since package 'wheel' is not installed.
Installing collected packages: psutil
Running setup.py install for psutil ... done
Successfully installed psutil-5.7.0
admin@XXXXXX:~$
Can you help and let me know what I've done wrong ?
Steve Dennis
root@xxxxxxxxxx # /opt/csw/bin/pip install psutil==5.7.0
/opt/csw/bin/gcc-5.2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -m32 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=570 -DPSUTIL_SUNOS=1 -DNEW_MIB_COMPLIANT=1 -I/opt/csw/include/python2.7 -c psutil/_psutil_common.c -o build/temp.solaris-2.11-sun4v.32bit-2.7/psutil/_psutil_common.o
unable to execute '/opt/csw/bin/gcc-5.2': No such file or directory
error: command '/opt/csw/bin/gcc-5.2' failed with exit status 1
----------------------------------------
Command "/opt/csw/bin/python2.7 -u -c "import setuptools, tokenize;file='/tmp/pip-build-TxNAvo/psutil/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-KW04Mu-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-TxNAvo/psutil/
You are using pip version 8.1.2, however version 22.0.4 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
root@xxxxxxxx # ls -ld /opt/csw/bin/gcc-5.2
/opt/csw/bin/gcc-5.2: No such file or directory
root@xxxxxxxx # gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/gcc/5/lib/gcc/sparcv9-sun-solaris2.11/5.4.0/lto-wrapper
Target: sparcv9-sun-solaris2.11
Configured with: /builds/ul11u3sru-gate/components/gcc5/gcc-5.4.0/configure CC='/usr/gcc/4.7/bin/gcc -m64' CXX='/usr/gcc/4.7/bin/g++ -m64' --prefix=/usr/gcc/5 --mandir=/usr/gcc/5/share/man --bindir=/usr/gcc/5/bin --libdir=/usr/gcc/5/lib --sbindir=/usr/gcc/5/sbin --infodir=/usr/gcc/5/share/info --libexecdir=/usr/gcc/5/lib --enable-languages=c,c++,fortran,objc --enable-shared --enable-initfini-array --disable-rpath --with-system-zlib --with-build-config=no --with-gmp-include=/usr/include/gmp --with-mpfr-include=/usr/include/mpfr --without-gnu-ld --with-ld=/usr/bin/ld --with-gnu-as --with-as=/usr/gnu/bin/as 'BOOT_CFLAGS=-g -O2' sparcv9-sun-solaris2.11
Thread model: posix
gcc version 5.4.0 (GCC)
root@xxxx #
root@xxxxxxx # pkg info entire
Name: entire
Summary: entire incorporation including Support Repository Update (Oracle Solaris 11.3.36.24.0).
Description: This package constrains system package versions to the same
build. WARNING: Proper system update and correct package
selection depend on the presence of this incorporation.
Removing this package will result in an unsupported system.
For more information see:
https://support.oracle.com/rs?type=doc&id=2433413.1
Category: Meta Packages/Incorporations
State: Installed
Publisher: solaris
Version: 0.5.11 (Oracle Solaris 11.3.36.24.0)
Build Release: 5.11
Branch: 0.175.3.36.0.24.0
Packaging Date: Wed Jan 13 20:40:04 2021
Size: 5.46 kB
FMRI: pkg://solaris/[email protected],5.11-0.175.3.36.0.24.0:20210113T204004Z
root@xxxxxxxxxx #
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.