InfluxDB+Grafana persistence and graphing

influxdb
graphs
grafana
Tags: #<Tag:0x00007fd30df5d3f8> #<Tag:0x00007fd30df5d290> #<Tag:0x00007fd30df5d0d8>

(Sebastian) #427

IIrc influxdb is writing log messages for every single metric it received which puts heavyy load on the SD cards of rPI’s. Theres a setting to disable this which helped me to reduce load on the system (iowait).


(Sergey M) #428

please specify, how did you do it?


(Angelos) #429

I think that he is referring to something like:

(not sure if @waitz_sebastian is using the same settings)


(Sergey M) #430

Thank you!


(Patrik) #431

Hey guys,

i have some problems with the influxDb! All was fine but yesterday after the work i have seen that my grafana graphs are empty. If i looked into the logs i found a lot of error messages.
I have no idea what is going wrong, i hope you can help me.

A short cut of my openhab.log:

2017-11-23 20:04:57.426 [ERROR] [.internal.InfluxDBPersistenceService] - database connection failed
retrofit.RetrofitError: Connection refused (Connection refused)
        at retrofit.RetrofitError.networkError(RetrofitError.java:27)
        at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:395)
        at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:240)
        at org.influxdb.impl.$Proxy112.ping(Unknown Source)
        at org.influxdb.impl.InfluxDBImpl.ping(InfluxDBImpl.java:114)
        at org.openhab.persistence.influxdb.internal.InfluxDBPersistenceService.checkConnection(InfluxDBPersistenceService.java:171)
        at org.openhab.persistence.influxdb.internal.InfluxDBPersistenceService.activate(InfluxDBPersistenceService.java:144)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_152]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_152]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_152]
        at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_152]
        at org.apache.felix.scr.impl.inject.BaseMethod.invokeMethod(BaseMethod.java:224)
        at org.apache.felix.scr.impl.inject.BaseMethod.access$500(BaseMethod.java:39)
        at org.apache.felix.scr.impl.inject.BaseMethod$Resolved.invoke(BaseMethod.java:617)
        at org.apache.felix.scr.impl.inject.BaseMethod.invoke(BaseMethod.java:501)
        at org.apache.felix.scr.impl.inject.ActivateMethod.invoke(ActivateMethod.java:302)
        at org.apache.felix.scr.impl.inject.ActivateMethod.invoke(ActivateMethod.java:294)
        at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:297)[31:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:108)[31:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:906)[31:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:879)[31:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:823)[31:org.apache.felix.scr:2.0.6]
        at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse$1.run(ServiceFactoryUse.java:212)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at java.security.AccessController.doPrivileged(Native Method)[:1.8.0_152]
        at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:210)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.getService(ServiceFactoryUse.java:111)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.serviceregistry.ServiceConsumer$2.getService(ServiceConsumer.java:45)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:496)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:461)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.BundleContextImpl.getService(BundleContextImpl.java:619)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at com.eclipsesource.jaxrs.publisher.internal.ResourceTracker.addingService(ResourceTracker.java:39)[9:com.eclipsesource.jaxrs.publisher:5.3.1.201602281253]
        at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)[org.osgi.core-6.0.0.jar:]
        at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870)[org.osgi.core-6.0.0.jar:]
        at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[org.osgi.core-6.0.0.jar:]
        at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)[org.osgi.core-6.0.0.jar:]
        at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901)[org.osgi.core-6.0.0.jar:]
        at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:914)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:886)[31:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:873)[31:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:132)[31:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:940)[31:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:740)[31:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.enableInternal(AbstractComponentManager.java:674)[31:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:429)[31:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:657)[31:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.BundleComponentActivator.initialEnable(BundleComponentActivator.java:341)[31:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:403)[31:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.Activator.access$200(Activator.java:54)[31:org.apache.felix.scr:2.0.6]
        at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:278)[31:org.apache.felix.scr:2.0.6]
        at org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:259)[31:org.apache.felix.scr:2.0.6]
        at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:232)[31:org.apache.felix.scr:2.0.6]
        at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:482)[org.osgi.core-6.0.0.jar:]
        at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:415)[org.osgi.core-6.0.0.jar:]
        at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232)[org.osgi.core-6.0.0.jar:]
        at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444)[org.osgi.core-6.0.0.jar:]
        at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:902)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:165)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:75)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:67)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:102)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.Module.publishEvent(Module.java:466)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.Module.start(Module.java:457)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
Caused by: java.net.ConnectException: Connection refused (Connection refused)
        at java.net.PlainSocketImpl.socketConnect(Native Method)[:1.8.0_152]
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)[:1.8.0_152]
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)[:1.8.0_152]
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)[:1.8.0_152]
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)[:1.8.0_152]
        at java.net.Socket.connect(Socket.java:589)[:1.8.0_152]
        at com.squareup.okhttp.internal.Platform.connectSocket(Platform.java:100)
        at com.squareup.okhttp.internal.http.SocketConnector.connectRawSocket(SocketConnector.java:160)
        at com.squareup.okhttp.internal.http.SocketConnector.connectCleartext(SocketConnector.java:67)
        at com.squareup.okhttp.Connection.connect(Connection.java:152)
        at com.squareup.okhttp.Connection.connectAndSetOwner(Connection.java:185)
        at com.squareup.okhttp.OkHttpClient$1.connectAndSetOwner(OkHttpClient.java:128)
        at com.squareup.okhttp.internal.http.HttpEngine.nextConnection(HttpEngine.java:341)
        at com.squareup.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:330)
        at com.squareup.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:248)
        at com.squareup.okhttp.Call.getResponse(Call.java:273)
        at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:230)
        at com.squareup.okhttp.Call.getResponseWithInterceptorChain(Call.java:201)
        at com.squareup.okhttp.Call.execute(Call.java:81)
        at retrofit.client.OkClient.execute(OkClient.java:53)
        at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:326)
        ... 77 more
2017-11-23 20:04:59.652 [ERROR] [.internal.InfluxDBPersistenceService] - database connection error Connection refused (Connection refused)
2017-11-23 20:04:59.654 [ERROR] [.internal.InfluxDBPersistenceService] - database connection does not work for now, will retry to use the database.
2017-11-23 20:05:00.102 [ERROR] [g.eclipse.smarthome.core.persistence] - [org.eclipse.smarthome.core.persistence.persistencemanager(43)] The addPersistenceService method has thrown an exception

After this message i get some other errors:

2017-11-23 20:10:10.808 [ERROR] [org.influxdb.impl.BatchProcessor    ] - Batch could not be sent. Data will be lost
java.lang.RuntimeException: {"error":"timeout"}

        at org.influxdb.impl.InfluxDBErrorHandler.handleError(InfluxDBErrorHandler.java:19)[200:org.openhab.persistence.influxdb:1.10.0]
        at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:242)[200:org.openhab.persistence.influxdb:1.10.0]
        at org.influxdb.impl.$Proxy112.writePoints(Unknown Source)[200:org.openhab.persistence.influxdb:1.10.0]
        at org.influxdb.impl.InfluxDBImpl.write(InfluxDBImpl.java:151)[200:org.openhab.persistence.influxdb:1.10.0]
        at org.influxdb.impl.BatchProcessor.write(BatchProcessor.java:171)[200:org.openhab.persistence.influxdb:1.10.0]
        at org.influxdb.impl.BatchProcessor$1.run(BatchProcessor.java:144)[200:org.openhab.persistence.influxdb:1.10.0]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_152]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)[:1.8.0_152]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)[:1.8.0_152]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)[:1.8.0_152]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[:1.8.0_152]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)[:1.8.0_152]
        at java.lang.Thread.run(Thread.java:748)[:1.8.0_152]
2017-11-23 20:10:21.007 [ERROR] [org.influxdb.impl.BatchProcessor    ] - Batch could not be sent. Data will be lost
java.lang.RuntimeException: {"error":"timeout"}

        at org.influxdb.impl.InfluxDBErrorHandler.handleError(InfluxDBErrorHandler.java:19)[200:org.openhab.persistence.influxdb:1.10.0]
        at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:242)[200:org.openhab.persistence.influxdb:1.10.0]
        at org.influxdb.impl.$Proxy112.writePoints(Unknown Source)[200:org.openhab.persistence.influxdb:1.10.0]
        at org.influxdb.impl.InfluxDBImpl.write(InfluxDBImpl.java:151)[200:org.openhab.persistence.influxdb:1.10.0]
        at org.influxdb.impl.BatchProcessor.write(BatchProcessor.java:171)[200:org.openhab.persistence.influxdb:1.10.0]
        at org.influxdb.impl.BatchProcessor$1.run(BatchProcessor.java:144)[200:org.openhab.persistence.influxdb:1.10.0]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_152]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)[:1.8.0_152]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)[:1.8.0_152]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)[:1.8.0_152]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[:1.8.0_152]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)[:1.8.0_152]
        at java.lang.Thread.run(Thread.java:748)[:1.8.0_152]

I also activate the influxdb.log in openhab log.config

2017-11-23 20:07:37.359 [DEBUG] [.internal.InfluxDBPersistenceService] - influxdb persistence service deactivated
2017-11-23 20:07:37.363 [DEBUG] [.InfluxDBPersistenceServiceActivator] - InfluxDB persistence bundle has been stopped.
2017-11-23 20:07:37.366 [DEBUG] [org.openhab.persistence.influxdb    ] - BundleEvent STOPPED - org.openhab.persistence.influxdb
2017-11-23 20:09:10.879 [DEBUG] [org.openhab.persistence.influxdb    ] - BundleEvent STARTING - org.openhab.persistence.influxdb
2017-11-23 20:09:10.962 [DEBUG] [.InfluxDBPersistenceServiceActivator] - InfluxDB persistence bundle has been started.
2017-11-23 20:09:10.965 [DEBUG] [org.openhab.persistence.influxdb    ] - BundleEvent STARTED - org.openhab.persistence.influxdb
2017-11-23 20:09:11.042 [DEBUG] [org.openhab.persistence.influxdb    ] - ServiceEvent REGISTERED - {org.openhab.core.persistence.PersistenceService, org.openhab.core.persistence.QueryablePersistenceService}={service.pid=org.openhab.influxdb, db=openhab_db, user=openhab, url=http://localhost:8086, password=openhab, component.name=org.openhab.persistence.influxdb, retentionPolicy=autogen, component.id=206, service.id=331, service.bundleid=200, service.scope=bundle} - org.openhab.persistence.influxdb
2017-11-23 20:09:11.133 [DEBUG] [.internal.InfluxDBPersistenceService] - influxdb persistence service activated
2017-11-23 20:09:16.098 [DEBUG] [.internal.InfluxDBPersistenceService] - database status is OK, version is 1.3.7
2017-11-23 20:09:16.349 [DEBUG] [.internal.InfluxDBPersistenceService] - got a query
2017-11-23 20:09:16.358 [TRACE] [.internal.InfluxDBPersistenceService] - Filter: itemname: draussen_Temperatur, ordering: DESCENDING, state: null,  operator: EQ, getBeginDate: null, getEndDate: null, getPageSize: 1, getPageNumber: 0
2017-11-23 20:09:16.365 [DEBUG] [.internal.InfluxDBPersistenceService] - descending ordering
2017-11-23 20:09:16.371 [TRACE] [.internal.InfluxDBPersistenceService] - appending limit 1
2017-11-23 20:09:16.373 [TRACE] [.internal.InfluxDBPersistenceService] - startEntryNum 0
2017-11-23 20:09:16.400 [DEBUG] [.internal.InfluxDBPersistenceService] - query string: select value from "autogen"."draussen_Temperatur" ORDER BY time DESC limit 1
2017-11-23 20:09:18.125 [DEBUG] [.internal.InfluxDBPersistenceService] - query returned no series
2017-11-23 20:10:00.111 [TRACE] [.internal.InfluxDBPersistenceService] - Tried to get item from item class class org.openhab.core.library.items.NumberItem, state is 19.01
2017-11-23 20:10:00.122 [TRACE] [.internal.InfluxDBPersistenceService] - found fractional part
2017-11-23 20:10:00.125 [DEBUG] [.internal.InfluxDBPersistenceService] - got DecimalType value 19.01
2017-11-23 20:10:00.129 [TRACE] [.internal.InfluxDBPersistenceService] - storing schlafzimmer_Temperatur in influxdb value 19.01, schlafzimmer_Temperatur (Type=NumberItem, State=19.01)
2017-11-23 20:10:00.366 [TRACE] [.internal.InfluxDBPersistenceService] - Tried to get item from item class class org.openhab.core.library.items.NumberItem, state is 59.83
2017-11-23 20:10:00.370 [TRACE] [.internal.InfluxDBPersistenceService] - found fractional part
2017-11-23 20:10:00.373 [DEBUG] [.internal.InfluxDBPersistenceService] - got DecimalType value 59.83
2017-11-23 20:10:00.377 [TRACE] [.internal.InfluxDBPersistenceService] - storing schlafzimmer_Luftfeuchtigkeit in influxdb value 59.83, schlafzimmer_Luftfeuchtigkeit (Type=NumberItem, State=59.83)
2017-11-23 20:10:00.380 [TRACE] [.internal.InfluxDBPersistenceService] - Tried to get item from item class class org.openhab.core.library.items.NumberItem, state is 13.39
2017-11-23 20:10:00.384 [TRACE] [.internal.InfluxDBPersistenceService] - found fractional part
2017-11-23 20:10:00.387 [DEBUG] [.internal.InfluxDBPersistenceService] - got DecimalType value 13.39
2017-11-23 20:10:00.390 [TRACE] [.internal.InfluxDBPersistenceService] - storing draussen_Temperatur in influxdb value 13.39, draussen_Temperatur (Type=NumberItem, State=13.39)
2017-11-23 20:10:00.394 [TRACE] [.internal.InfluxDBPersistenceService] - Tried to get item from item class class org.openhab.core.library.items.NumberItem, state is 69.37
2017-11-23 20:10:00.399 [TRACE] [.internal.InfluxDBPersistenceService] - found fractional part
2017-11-23 20:10:00.403 [DEBUG] [.internal.InfluxDBPersistenceService] - got DecimalType value 69.37
2017-11-23 20:10:00.406 [TRACE] [.internal.InfluxDBPersistenceService] - storing draussen_Luftfeuchtigkeit in influxdb value 69.37, draussen_Luftfeuchtigkeit (Type=NumberItem, State=69.37)
2017-11-23 20:10:00.414 [TRACE] [.internal.InfluxDBPersistenceService] - Tried to get item from item class class org.openhab.core.library.items.NumberItem, state is 22.30
2017-11-23 20:10:00.418 [TRACE] [.internal.InfluxDBPersistenceService] - found fractional part
2017-11-23 20:10:00.421 [DEBUG] [.internal.InfluxDBPersistenceService] - got DecimalType value 22.3
2017-11-23 20:10:00.427 [TRACE] [.internal.InfluxDBPersistenceService] - storing wz_hz_temperatur in influxdb value 22.3, wz_hz_temperatur (Type=NumberItem, State=22.30)
2017-11-23 20:10:00.430 [TRACE] [.internal.InfluxDBPersistenceService] - Tried to get item from item class class org.openhab.core.library.items.NumberItem, state is 53.00
2017-11-23 20:10:00.434 [TRACE] [.internal.InfluxDBPersistenceService] - found fractional part
2017-11-23 20:10:00.437 [DEBUG] [.internal.InfluxDBPersistenceService] - got DecimalType value 53.0
2017-11-23 20:10:00.440 [TRACE] [.internal.InfluxDBPersistenceService] - storing wz_hz_luftfeuchtigkeit in influxdb value 53.0, wz_hz_luftfeuchtigkeit (Type=NumberItem, State=53.00)
2017-11-23 20:10:00.444 [TRACE] [.internal.InfluxDBPersistenceService] - Tried to get item from item class class org.openhab.core.library.items.NumberItem, state is 17.85
2017-11-23 20:10:00.447 [TRACE] [.internal.InfluxDBPersistenceService] - found fractional part
2017-11-23 20:10:00.450 [DEBUG] [.internal.InfluxDBPersistenceService] - got DecimalType value 17.85
2017-11-23 20:10:00.459 [TRACE] [.internal.InfluxDBPersistenceService] - storing bad_Keller_Temperatur in influxdb value 17.85, bad_Keller_Temperatur (Type=NumberItem, State=17.85)
2017-11-23 20:10:00.463 [TRACE] [.internal.InfluxDBPersistenceService] - Tried to get item from item class class org.openhab.core.library.items.NumberItem, state is 71.35
2017-11-23 20:10:00.467 [TRACE] [.internal.InfluxDBPersistenceService] - found fractional part
2017-11-23 20:10:00.471 [DEBUG] [.internal.InfluxDBPersistenceService] - got DecimalType value 71.35
2017-11-23 20:10:00.474 [TRACE] [.internal.InfluxDBPersistenceService] - storing bad_Keller_Luftfeuchtigkeit in influxdb value 71.35, bad_Keller_Luftfeuchtigkeit (Type=NumberItem, State=71.35)
2017-11-23 20:20:00.013 [TRACE] [.internal.InfluxDBPersistenceService] - Tried to get item from item class class org.openhab.core.library.items.NumberItem, state is 19.01
2017-11-23 20:20:00.014 [TRACE] [.internal.InfluxDBPersistenceService] - found fractional part
2017-11-23 20:20:00.016 [DEBUG] [.internal.InfluxDBPersistenceService] - got DecimalType value 19.01
2017-11-23 20:20:00.018 [TRACE] [.internal.InfluxDBPersistenceService] - storing schlafzimmer_Temperatur in influxdb value 19.01, schlafzimmer_Temperatur (Type=NumberItem, State=19.01)
2017-11-23 20:20:00.020 [TRACE] [.internal.InfluxDBPersistenceService] - Tried to get item from item class class org.openhab.core.library.items.NumberItem, state is 59.83
2017-11-23 20:20:00.023 [TRACE] [.internal.InfluxDBPersistenceService] - found fractional part
2017-11-23 20:20:00.026 [DEBUG] [.internal.InfluxDBPersistenceService] - got DecimalType value 59.83
2017-11-23 20:20:00.029 [TRACE] [.internal.InfluxDBPersistenceService] - storing schlafzimmer_Luftfeuchtigkeit in influxdb value 59.83, schlafzimmer_Luftfeuchtigkeit (Type=NumberItem, State=59.83)
2017-11-23 20:20:00.037 [TRACE] [.internal.InfluxDBPersistenceService] - Tried to get item from item class class org.openhab.core.library.items.NumberItem, state is 13.31
2017-11-23 20:20:00.039 [TRACE] [.internal.InfluxDBPersistenceService] - found fractional part
2017-11-23 20:20:00.042 [DEBUG] [.internal.InfluxDBPersistenceService] - got DecimalType value 13.31
2017-11-23 20:20:00.045 [TRACE] [.internal.InfluxDBPersistenceService] - storing draussen_Temperatur in influxdb value 13.31, draussen_Temperatur (Type=NumberItem, State=13.31)
2017-11-23 20:20:00.048 [TRACE] [.internal.InfluxDBPersistenceService] - Tried to get item from item class class org.openhab.core.library.items.NumberItem, state is 71.15
2017-11-23 20:20:00.056 [TRACE] [.internal.InfluxDBPersistenceService] - found fractional part
2017-11-23 20:20:00.057 [DEBUG] [.internal.InfluxDBPersistenceService] - got DecimalType value 71.15
2017-11-23 20:20:00.058 [TRACE] [.internal.InfluxDBPersistenceService] - storing draussen_Luftfeuchtigkeit in influxdb value 71.15, draussen_Luftfeuchtigkeit (Type=NumberItem, State=71.15)
2017-11-23 20:20:00.060 [TRACE] [.internal.InfluxDBPersistenceService] - Tried to get item from item class class org.openhab.core.library.items.NumberItem, state is 22.30
2017-11-23 20:20:00.063 [TRACE] [.internal.InfluxDBPersistenceService] - found fractional part
2017-11-23 20:20:00.064 [DEBUG] [.internal.InfluxDBPersistenceService] - got DecimalType value 22.3
2017-11-23 20:20:00.066 [TRACE] [.internal.InfluxDBPersistenceService] - storing wz_hz_temperatur in influxdb value 22.3, wz_hz_temperatur (Type=NumberItem, State=22.30)
2017-11-23 20:20:00.067 [TRACE] [.internal.InfluxDBPersistenceService] - Tried to get item from item class class org.openhab.core.library.items.NumberItem, state is 52.00
2017-11-23 20:20:00.069 [TRACE] [.internal.InfluxDBPersistenceService] - found fractional part
2017-11-23 20:20:00.071 [DEBUG] [.internal.InfluxDBPersistenceService] - got DecimalType value 52.0
2017-11-23 20:20:00.073 [TRACE] [.internal.InfluxDBPersistenceService] - storing wz_hz_luftfeuchtigkeit in influxdb value 52.0, wz_hz_luftfeuchtigkeit (Type=NumberItem, State=52.00)
2017-11-23 20:20:00.075 [TRACE] [.internal.InfluxDBPersistenceService] - Tried to get item from item class class org.openhab.core.library.items.NumberItem, state is 17.85
2017-11-23 20:20:00.082 [TRACE] [.internal.InfluxDBPersistenceService] - found fractional part
2017-11-23 20:20:00.084 [DEBUG] [.internal.InfluxDBPersistenceService] - got DecimalType value 17.85
2017-11-23 20:20:00.090 [TRACE] [.internal.InfluxDBPersistenceService] - storing bad_Keller_Temperatur in influxdb value 17.85, bad_Keller_Temperatur (Type=NumberItem, State=17.85)
2017-11-23 20:20:00.092 [TRACE] [.internal.InfluxDBPersistenceService] - Tried to get item from item class class org.openhab.core.library.items.NumberItem, state is 71.35
2017-11-23 20:20:00.094 [TRACE] [.internal.InfluxDBPersistenceService] - found fractional part
2017-11-23 20:20:00.096 [DEBUG] [.internal.InfluxDBPersistenceService] - got DecimalType value 71.35
2017-11-23 20:20:00.097 [TRACE] [.internal.InfluxDBPersistenceService] - storing bad_Keller_Luftfeuchtigkeit in influxdb value 71.35, bad_Keller_Luftfeuchtigkeit (Type=NumberItem, State=71.35)

This log looks fine, i think.

Here my influxdb.config

Strategies {
    everyMinute : "0 * * * * ?"
    everyHour   : "0 0 * * * ?"
    everyDay    : "0 0 0 * * ?"
    everyTenMinutes : "0 0/10 * * * ?"
}

Items {
    schlafzimmer_Temperatur:strategy = everyTenMinutes, restoreOnStartup 
    schlafzimmer_Luftfeuchtigkeit:strategy = everyTenMinutes, restoreOnStartup 
    draussen_Temperatur:strategy = everyTenMinutes, restoreOnStartup 
    draussen_Luftfeuchtigkeit:strategy = everyTenMinutes, restoreOnStartup 
    wz_hz_temperatur:strategy = everyTenMinutes, restoreOnStartup 
    wz_hz_luftfeuchtigkeit:strategy = everyTenMinutes, restoreOnStartup 
    bad_Keller_Temperatur:strategy = everyTenMinutes, restoreOnStartup 
    bad_Keller_Luftfeuchtigkeit:strategy = everyTenMinutes, restoreOnStartup 
}

Here my influxdb.cfg:

url=http://localhost:8086
user=openhab
password=openhab
db=openhab_db
retentionPolicy=autogen

I can connect to the influxDd via console -> influx without problems

If you need some more informations please let it know me.

EDIT:

i startet influx with the following line to see the stdout

/usr/bin/influxd -config /etc/influxdb/influxdb.conf

is it normal that the influxDb starts very slow? i store the data on a network drive is that a problem? after some time i get the following error:

Failed to open shard: 4: [shard 4] error opening file /influxdb/data/openhab_db/autogen/4/000000134-000000001.tsm: open /influxdb/data/openhab_db/autogen/4/000000134-000000001.tsm: too many open files service=store

what’s wrong with my installation? i only log a few items every 10 minutes…


(Patrik) #432

Is nobody here who can help me?


( ) #433

This is not an openHAB error but rather an InfluxDB error. Google brings forth some interesting search results. You’ll have to check those and hopefully you’ll find a solution.


(X3fil) #434

Hello!
Is there a way to import old data from a MySQL database to InfluxDB having OH2.2? The first script seems to work only with OH2.0.
Then, on a raspberry-like system is the performance better compared to MySQL?

Thanks, Simon


(Rich Koshak) #435

There is a 2.1 vesion of the script posted here

Unless there was another change between 2.1 and 2.2, which could happen but seems unlikely, the 2.1 script should work.


(Juelicher) #436

Grafana is also able to use MySQL as a data source, so - depending on what you want, migrating the data to influxdb might not be necessary.

Some time ago I installed influxdb only to use it with grafana, in addition to my other persistence service but currently I am switching al graphs to the postgresql backend, as I am using this for other purposes as well and that way I have one less service to maintain.


(X3fil) #437

Thank you, it’s working :slight_smile:


(SiHui) #438

Did you find a solution? Having the same problem …


(Patrik) #439

No i havent. Actually i had remove influx and graphana. I will start a Second try in my christmas vacation. I have bought a new QNAP nas. I will try it with the nas :slight_smile:


(Juelicher) #440

Hi,

currently I am trying out the Library from https://github.com/wborn/smarthome-grafana (BTW: Great Library, thanks a lot!)

In debug mode I can see, that all links are generated correctly. In “normal” mode, the grafana panel is shown when first opening a page in the ui. When trying to change the time span, as in the demo, the grafana panel is not updated (also the links are updated correctly).

In the javascript console I see a “same origin error”, probably because grafana listens on port 3000 and my openhab on port 9080, so these don’t match. I wonder, if this might the reason for not updating the panel and what to do to fix it.

Thanks in advance for your help!


(Christophe P) #441

I’ve got a setup with Influxdb and Grafana implemented as two docker container, both using last version. I have a “production” base and a “test” base for my experimentation on a second OH2 instance. However, my test base is crippled with lots of measurements due to multiple test.

What are you doing to simply clean up sets of measurements when you removed things ?

I have installed the Influxdb admin plugin in grafana, but it’s not very efficient do to these kind of task.


(Max1968) #442

Does anyone have Influxdb correctly persist locations, it seems not to work for me with 2.2 stable (and prior) ?

I’m persisting everything:

Strategies {
        everyMinute     :       "0 * * * * ?"
        everyHour       :       "0 0 * * * ?"
        everyDay        :       "0 0 0 * * ?"
    default = everyMinute, everyChange
}

Items {
    * : strategy = everyChange, everyHour, everyDay, restoreOnStartup
}

I’m using the iCloud binding for all my devices like follows:

String          MacBookDadBatteryStatus         "Battery Status [%s]"           <battery>       (giCloudDadMacBook)     {channel="icloud:device:abc:def:batteryStatus"}
Number          MacBookBatteryLevel             "Battery Level [%.0f %%]"       <battery>       (giCloudDadMacBook)     {channel="icloud:device:abc:def:batteryLevel"}
Switch          MacBookDadFindMyPhone           "Find Dad MacBook"                              (giCloudDadMacBook)     ["Switchable"]  {channel="icloud:device:abc:def:findMyPhone"}
Location        MacBookDadLocation              "Coordinates"                                   (giCloudDadMacBook)     {channel="icloud:device:abc:def:location"}
String          MacBookDadLocationString        "[%s]"                          <place>
Number          MacBookDadLocationAccuracy      "Coordinates Accuracy [%.0f m]"                 (giCloudDadMacBook)     {channel="icloud:device:abc:def:locationAccuracy"}
DateTime        MacBookDadLocationLastUpdate    "Last Update [%1$td.%1$tm.%1$tY, %1$tH:%1$tM]"  (giCloudDadMacBook)     {channel="icloud:device:abc:def:locationLastUpdate"}

and I have the following rule to translate location into readable address:

rule "MacBook Dad formatted address"
when
        Item MacBookDadLocation changed
then
        val _url = "https://maps.googleapis.com/maps/api/geocode/json?latlng=" + MacBookDadLocation.state.toString + "&key=abcdef"
        val _geocodeJSON = sendHttpGetRequest(_url)
        val _address = transform("JSONPATH", "$.results[0].formatted_address", _geocodeJSON)
        MacBookDadLocationString.postUpdate(_address)
end

persistence works fine for all the items except location, for example for changes to the LocationString I get the following in trace log:

2017-12-21 15:04:15.226 [vent.ItemStateChangedEvent] - MacBookDadLocationString changed from some street, some city, Germany to some street, some city, Germany
2017-12-21 15:04:15.404 [TRACE] [.internal.InfluxDBPersistenceService] - Tried to get item from item class class org.openhab.core.library.items.StringItem, state is some street, some city, Germany
2017-12-21 15:04:15.404 [DEBUG] [.internal.InfluxDBPersistenceService] - got String value some street, some city, Germany
2017-12-21 15:04:15.404 [TRACE] [.internal.InfluxDBPersistenceService] - storing MacBookDadLocationString in influxdb value some street, some city, Germany, MacBookDadLocationString (Type=StringItem, State=some street, some city, Germany)

while for changes to Location I only get something like this, it seems it doesnt even try to persist the value:

2017-12-21 15:09:16.622 [vent.ItemStateChangedEvent] - MacBookDadLocation changed from 57.16784242952166,14.695187186432912 to 52.16784165925779,12.695187517415263


Persistence not working for GPS location formatted XX.XXX75788937955,-X.XXXX170208076405
(Carsten) #443

Maybe a dump question…but I am not able to find this grafana.ini on any folder of the installation :smiley: But I got access to the dashboard…!?


(Cyborg) #444

I have the same situation. I can’t make persist the iPhone location via the “icloud binding”

Simply seems to be ignored. I guess, as you do, that it’s to do with the location GPS tag persistance.


(Marco Schnubel) #445

Same problem here. Grafana and influx are working great. But without anonymous access i am not able to display it on a wall mounted tablet :frowning: only on my personal computer logged in to grafana


(Cyborg) #446

I’ve been trying to DEBUG but nothing of interest in the logs with DEBUG enabled. No information is thrown out whatsoever.

I have a thought on what could be failing. Maybe the iCloud plugin is not ready for persist and a method needs to be created?