Collection of collectd plugin to get stats from openstack.
It currently consists of:
collectd-nova-hypervisor-stats
: get the equivalent ofnova hypervisor-stats
.collectd-neutron-floatingips
: get the used and estimated total number of floating ipcollectd-cinder-stats
: get the equivalent ofcinder {snapshot-}list --all_tenant
collectd-nova-aggregate
: get hypervisor stats splitted by aggregatecollectd-keystone-stats
: get basic (user, tenant) keystone stats
make install
or
PREFIX=/opt/collectd make install
Add the following to your collectd config and restart collectd.
<LoadPlugin "python">
Globals true
</LoadPlugin>
<Plugin "python">
# collectd-nova-hypervisor-stats.py is at /usr/local/lib/collectd-nova-hypervisor-stats.py
ModulePath "/usr/local/lib"
Import "collectd-nova-hypervisor-stats"
<Module "collectd-nova-hypervisor-stats">
AuthURL "http://myopenstack.cloud.home:5000/v2.0"
Username "admin"
Password "hardhard"
Tenant "admin"
<Overcommit>
Vcpus 16
Memory 1.5
</Overcommit>
</Module>
</Plugin>
The following parameters are required:
AuthURL
- The identity service for openstack;Username
- The user to use to log in (must have admin role);Password
- Well .... the password;Tenant
- Tenant to use
The following parameters are optional:
-
EndpointType
- The type of the endpoint. By default "internalURL". -
Verbose
- Add some verbosity, visible in the collectd logs. -
Overcommit
- Take the name of the aggregate as parameter and theVcpus
andMemory
parameter as child node.
Add the following to your collectd config and restart collectd.
<LoadPlugin "python">
Globals true
</LoadPlugin>
<Plugin "python">
ModulePath "/usr/local/lib"
Import "collectd-neutron-floatingips"
<Module "collectd-neutron-floatingips">
AuthURL "http://myopenstack.cloud.home:5000/v2.0"
Username "admin"
Password "hardhard"
Tenant "admin"
</Module>
</Plugin>
The following parameters are required:
AuthURL
- The identity service for openstack;Username
- The user to use to log in (must have admin role);Password
- Well .... the password;Tenant
- Tenant to use
The following parameters are optional:
EndpointType
- The type of the endpoint. By default "internalURL".Verbose
- Add some verbosity, visible in the collectd logs.PublicNetwork
- Used for calculating a estimation of floating ip available. It's the name of the network where the public subnets are.public
by default, can benone
to deactivate it.
The total number of floating ip is an estimate as I do not take into account the IP allocation pool, where one can specify that only a part of the floating ips of the subnet are available. This speed up the calculation and is usually a good enough estimate. If you do not use this feature (IP allocation pool), then the calcul is correct: it removes two ips (network and broadcast) and if the gateway is enabled a third one.
Add the following to your collectd config and restart collectd.
<LoadPlugin "python">
Globals true
</LoadPlugin>
<Plugin "python">
ModulePath "/usr/local/lib"
Import "collectd-neutron-floatingips"
<Module "collectd-neutron-floatingips">
AuthURL "http://myopenstack.cloud.home:5000/v2.0"
Username "admin"
Password "hardhard"
Tenant "admin"
</Module>
</Plugin>
The following parameters are required:
AuthURL
- The identity service for openstack;Username
- The user to use to log in (must have admin role);Password
- Well .... the password;Tenant
- Tenant to use
The following parameters are optional:
EndpointType
- The type of the endpoint. By default "internalURL".Verbose
- Add some verbosity, visible in the collectd logs.
Graph the number of users and tenant. It requires admin role.
Add the following to your collectd config and restart collectd.
<LoadPlugin "python">
Globals true
</LoadPlugin>
<Plugin "python">
ModulePath "/usr/local/lib"
Import "collectd-keystone-stats"
<Module "collectd-keystone-stats">
AuthURL "http://myopenstack.cloud.home:5000/v2.0"
Username "admin"
Password "hardhard"
Tenant "admin"
</Module>
</Plugin>
The following parameters are required:
AuthURL
- The identity service for openstack;Username
- The user to use to log in (must have admin role);Password
- Well .... the password;Tenant
- Tenant to use
The following parameters are optional:
EndpointType
- The type of the endpoint. By default "internalURL".Verbose
- Add some verbosity, visible in the collectd logs.
Graph the equivalent of nova hypervisor-stats by splitted by aggregate. It requires admin role. Overcommit for cpus and memory can be given for each aggregate.
Add the following to your collectd config and restart collectd.
<LoadPlugin "python">
Globals true
</LoadPlugin>
<Plugin "python">
ModulePath "/usr/local/lib"
Import "collectd-nova-aggregate"
<Module "collectd-nova-aggregate">
AuthURL "http://myopenstack.cloud.home:5000/v2.0"
Username "admin"
Password "hardhard"
Tenant "admin"
<Overcommit "small">
Vcpus 30
Memory 2.5
</Overcommit>
</Module>
</Plugin>
The following parameters are required:
AuthURL
- The identity service for openstack;Username
- The user to use to log in (must have admin role);Password
- Well .... the password;Tenant
- Tenant to use
The following parameters are optional:
-
EndpointType
- The type of the endpoint. By default "internalURL". -
Verbose
- Add some verbosity, visible in the collectd logs. -
Overcommit
- Take the name of the aggregate as parameter and theVcpus
andMemory
parameter as child node.
Get the count of all instances by status as defined there
Add the following to your collectd config and restart collectd.
<LoadPlugin "python">
Globals true
</LoadPlugin>
<Plugin "python">
ModulePath "/usr/local/lib"
Import "collectd-instances-stats"
<Module "collectd-instances-stats">
AuthURL "http://myopenstack.cloud.home:5000/v2.0"
Username "admin"
Password "hardhard"
Tenant "admin"
</Module>
</Plugin>
The following parameters are required:
AuthURL
- The identity service for openstack;Username
- The user to use to log in (must have admin role);Password
- Well .... the password;Tenant
- Tenant to use
The following parameters are optional:
EndpointType
- The type of the endpoint. By default "internalURL".Verbose
- Add some verbosity, visible in the collectd logs.
A litle utility is given to run the plugin on the command line in the bin directory. To use it give the collectd script as argument and some other required parameters. Not all parameters are yet supported.
./bin/collectd-cli.py --script ./lib/collectd-nova-hypervisor-stats.py \
--auth_url $OS_AUTH_URL --username $OS_USERNAME --tenant $OS_TENANT_NAME --password $OS_PASSWORD
This was done using Librato collectd plugin