Zabbix API to get the details of traffic used by the applications - zabbix

I would like to get the details/usage of network traffic used by each application (not by host).
I tried and I was able to get the list of application running on a host, by using:
{
"jsonrpc": "2.0",
"method": "application.get",
"params": {
"output": "extend",
"hostids": "10107"
},
"auth": "02axxxxxxx6e1023exxx252cd2xx70",
"id": 1
}
but I need the network traffic consumption details:

There is no native way to do it.
The application.get api retrieves the application list from the template/host, Zabbix uses it as a grouping mechanism.
See Configuration -> Templates -> Pick one -> Applications

Related

Receiving empty json messages from edge device

I'm sending messages from a particle photon micro controller to a Azure IoT Hub. I monitor the outgoing messages from the particle portal and they seem to be just fine. Below is a recent sample:
{
"name": "*****",
"data": "{\"eventSentUtcTime\": \"2017-11-03 10:42:00\", \"machine\": \"x10\", \"eventType\": \"coffeeMaintenance\", \"data\": {\"category\": \"MillingPlantCoffee\", \"count\": \"24868\"}",
"ttl": 60,
"published_at": "2017-11-03T09:42:39.233Z",
"coreid": "*****",
"userid": "*****",
"version": 37,
"public": false,
"productID": 1427
}
But when I check incoming messages from the Azure IoT Hub, they're empty except the schema. I'm using the Device explorer from Azure's github for monitoring.
03.11.2017 10:42:09> Device: [*****], Data:[{"data":{"count":"","category":""},"eventType":"","machine":"","eventSentUtcTime":""}]
I double checked the incoming messages inside a sql database, which also displays an empty json message except the given schema.
data,eventType,machine,eventSentUtcTime,EventProcessedUtcTime,PartitionId,EventEnqueuedUtcTime,IoTHub
Record,,,,2017-11-03T10:01:26.8295948Z,1,2017-11-03T10:01:25.7270000Z,Record
The access policy I'm using has all permissions checked. I don't know where to problem lies.
It seems like your issue is more on the Particle connector side, assuming you are following this tutorial.

Zabbix API hidden hostgroup/hosts

I'm trying to get all hostgroups/hosts through the zabbix API.
I have used the following json requests:
{
"jsonrpc": "2.0",
"method": "hostgroup.get",
"params": {
"output": "extend"
},
"auth": "6f38cddc44cfbb6c1bd186f9a220b5a0",
"id": 1
}
The one for hosts differs only in "host.get" instead of "hostgroup.get".
But unfortunately some information is hidden. The frontend shows everything correct. But the API output is missing some hostgroupts/hosts.
It's bizarre because one of my self created hostgroups is displayed, the other one is not. Same happens with the hosts that are currently inside this hostgroup. As you can see I don't use any filter option.
Does somebody have a clue?
Thanks in advance!
If your user is not a Zabbix "superadmin", it must have permissions on those host groups. Otherwise you would not be able to retrieve groups or their members.

Context Broker, ONTIMEINTERVAL subscribe immediatelly sends request to reference

The problem is even if I put condValues to PT10S, when I send request to contextBroker it requests back the reference url rigth away, not after 10 sec, and then it continues to send requests at 10 sec.
My question: is there a way to avoid the first initial request?
Here is a body of the request that I send to server where contextBroker is installed.
{
"entities": [{
"type": "Cycle",
"isPattern": "false",
"id": "someid"
}],
"attributes": [
...
],
"reference": "someurl"
"duration": "P1M",
"notifyConditions": [{
"type": "ONTIMEINTERVAL",
"condValues": [
"PT10S"
]
}]
}
At the present moment (Orion 1.1) initial notification cannot be avoided. However, being able to configure that behaviour would be an interesting feature to develop in the future and, consecuently, a github issue was created time ago about it.
In addition, note that ONTIMEINTERVAL subscriptions are no longer supported so you should avoid to use them:
ONTIMEINTERVAL subscriptions have several problems (introduce state in CB, thus making horizontal scaling configuration much harder, and makes it difficult to introduce pagination/filtering). Actually, they aren't really needed, as any use case based on ONTIMEINTERVAL notification can be converted to an equivalent use case in which the receptor runs queryContext at the same frequency (and taking advantage of the features of queryContext, such as pagination or filtering).
EDIT: the posibility of avoiding initial notification has been finally implemented at Orion. Details are at this section of the documentation. It is now in the master branch (so if you use fiware/orion:latest docker you will get it) and will be include in next Orion version (2.2.0).

Setting up S3QL with FIWARE Object Storage GE (Openstack Swift)

I am trying to setup S3QL with Object Storage GE and there seems to be only one piece of information missing.
I successfully installed S3QL thanks to this pretty good tutorial: https://dmsimard.com/2014/09/29/s3ql-a-filesystem-over-http-with-swift/
Now I am stuck when trying to mount an object-container 'test' that I created in region 'Lannion2'.
The URL-syntax requires a 'region' to be defined (swiftks://<hostname>[:<port>]/<region>:<container>) but I have no clue how this maps to the fiware-stack. When trying the following command, s3ql seems to succeed in connecting and authenticating with Keystone but cannot find the region.
mkfs.s3ql swiftks://cloud.lab.fiware.org:4730/Lannion2:test --backend-options no-ssl
Enter backend login:
Enter backend passphrase:
Results in:
No accessible object storage service found in region Lannion2 (available regions: )
Unfortunately no available regions are listed in the response. Authentication works correctly as mistyping login or passphrase results in an authentication-error.
Is there any documentation about the naming of regions in keystone/fiware cloud?
Authenticate to keystone via:
Post http://cloud.lab.fi-ware.org:4730/v2.0/tokens with Content-type application/json and Body: {"auth": {"passwordCredentials":
{"username": "", "password": ""}, "tenantId":"***"}}
In the response, you should receive a list of endpoints, including a swift endpoint. There should be an entry there that looks like:
{"adminURL": "", "region": "Lannion2", "internalURL": ":8080/v1/AUTH_", "id": "", "publicURL": "/v1/AUTH_"}

Couchbase N1QL queries on server

I used the online N1QL tutorial to practices writing queries. Now that I have a couchbase server of my own, I want to query my own data.
My questions is
Where in the Couchbase server can I write my queries?
thanks
Remember that N1Q1 is still in Beta.
The way it works is that you have to run Couchbase Query Server (aka CBQ). It runs in a default port 8093 (see N1QL)
The query server will connect to the specified Couchbase instance/cluster.
e.g.
cbq-engine -couchbase <CB-location>
Once CB Query Engine up and running you can run command line client and in a command prompt can issue your N1QL statements, e.g.:
cbq -engine http://your-cb-host:8093/
cbq> SELECT 'Hello World' AS Greeting
{
"resultset": [
{
"Greeting": "Hello World"
}
],
"info": [
{
"caller": "http_response:160",
"code": 100,
"key": "total_rows",
"message": "1"
},
{
"caller": "http_response:162",
"code": 101,
"key": "total_elapsed_time",
"message": "4.0002ms"
}
]
}
N1QL is released and available as part of Couchbase Server.
Please download Couchbase Server 4.1
http://www.couchbase.com/nosql-databases/downloads
Learn more at: http://www.couchbase.com/n1ql
Just to note, there is a new developer preview of N1QL out now (http://docs.couchbase.com/developer/n1ql-dp3/n1ql-intro.html) and the way to connect to a Couchbase cluster has changed from the answer given by user1697575; it's now:
cbq-engine -datastore <CB-location>
The Couchbase query engine can also serve N1QL queries from a file system, and there is a file system included in the download that can be queried:
cbq-engine -datastore=dir:./data