NetApp SNMP monitoring - snmp

I'm writing a script to pull data from a NetApp filter, I'm trying to get networking data but looking at the MIB file I can see metrics like ifHighOutDiscards, ifLowOutDiscards and if64OutOctets.
What do these numbers mean? Do I need to convert them to something?

Related

Datadog monitoring Disk usage

I want to use datadog for monitoring my EC2 Instance Disk utilization and create alerts for it. I am using system.disk.in_use metric but I am not getting my root mount point in from sectionavg:system.disk.in_use{device:/dev/loop0} by {host} and my root mount point is /dev/root. I can see every loop mount point in the list but can't see the root. due to this, the data I am getting in the monitor is different than the actual server, for example, df -hT is showing 99% root in the server but on datadog monitoring it is showing 60%.
I am not too familiar with how to use datadog, can someone please help?
Try to research about it but not able to resolve the issue.
You can also try to use the device label to read in only the root volume such as:
avg:system.disk.in_use{device_label:/} by {host}
I personally found the metric system.disk.in_use to equal the total and instead added a formula that calculated the utilization using system.disk.total and system.disk.free to be more accurate.

Why did SNMP4J return different result with Net-SNMP?

I find that with Net-SNMP, I can get the normal ifPhysAddress result .But when I use SNMP4J,I get some wrong result.How to fix it ?
The Net-SNMP result:
The snmp4j result:
That's absolutely normal.
NET-SNMP ships with a set of default MIB documents, so when it makes SNMP operations derived data types (like PhysAddress for ifPhysAddress) can be interpreted more accurately according to the MIB documents.
However, when you consume the raw SNMP4J library, MIB documents are not involved and the only way is to print out ifPhysAddress as the base type of OCTET STRING which is effectively raw bytes and garble characters.
If you like to achieve the same output like NET-SNMP, you can buy SNMP4J's MIB library or search for other alternative ways.

Write time series data into hdfs partitioned by month and day?

I'm writing a program which save the time series data from kafka into hadoop. and I designed the directory struct like this:
event_data
|-2016
|-01
|-data01
|-data02
|-data03
|-2017
|-01
|-data01
Because the is a daemon task, I write a LRU-based manager to manage the opened file and close inactive file in time to avoid resource leaking, but the income data stream is not sorted by time, it's very common to open the existed file again to append new data.
I tried use FileSystem#append() method to open a OutputStream when file existed, but it run error on my hdfs cluster(Sorry, I can't offer the specific error here because it's several month ago and now I tried another solution).
Then I use another ways to achieve my goals:
Adding a sequence suffix to the file name when the same name file exists. now I have a lot of file in my hdfs. It looks very dirty.
My question is: what's the best practice for the circumstances?
Sorry that this is not a direct answer to your programming problem, but if you're open for all options rather than implement it by yourself, I'd like to share you our experiences with fluentd and it's HDFS (WebHDFS) Output Plugin.
Fluentd is a open source, pluggable data collector and by which you can build your data pipeline easily, it'll read data from inputs, process it and then write it to the specified outputs, in your scenario, the input is kafka and the output is HDFS. What you need to do is:
Config fluentd input following fluentd kafka plugin, you'll config the source part with your kafka/topic info
Enable webhdfs and append operation for your HDFS cluster, you can find how to do it following HDFS (WebHDFS) Output Plugin
Config your match part to write your data to HDFS, there's example on the plugin docs page. For partition your data by month and day, you can configure path parameter with time slice placeholders, something like:
path "/event_data/%Y/%m/data%d"
With this option to collect your data, you can then write your mapreduce job to do ETL or whatever you like.
I don't know if this is suitable for your problem, just provide one more option here.

Choosing Collectd time format

I'm pushing collectd stats to a fluentd instance via an http socket. The latter is complaining that the time format from collectd is a float not an integer. Here's an example output from collectd:
[{...,"time":1473707444.605,"interval":1.000,...]
As you can see, I'm outputting in JSON format.
I cannot modify this field in fluentd as it fails the message instantly*. So I have to specify a different time format in collectd. I like iso-8601 if at all possible.
Anyone know how to do that? I've trawled all the docs I can find but so far nothing :( I can't believe this is not specifiable.
*Edit: I was wrong about Fluentd not allowing time formatting. It does. However, my original question still stands as I think time formatting output should be possible somehow, no?
Collectd does not allow changing the format of the time output that is sends.
So I came across this issue while trying to store the "time" value in my backend database (influxdb). Although collectd does not allow changing the format, maybe an alternate is to do the conversion before sending it?
For example, I use ruby to parse the collectd time into a DateTime format before pushing it into the database
require 'date'
DateTime.strptime(collectdJsonStats.time.to_s,'%s')
where the 'collectdJsonStats' is the json blob that you are tring to send.

Bosun adding external collectors

What is the procedure to define new external collectors in bosun using scollector.
Can we write python or shell scripts to collect data?
The documentation around this is not quite up to date. You can do it as described in http://godoc.org/bosun.org/cmd/scollector#hdr-External_Collectors , but we also support JSON output which is better.
Either way, you write something and put it in the external collectors directory, followed by a frequency directory, and then an executable script or binary. Something like:
<external_collectors_dir>/<freq_sec>/foo.sh.
If the directory frequency is zero 0, then the the script is expected to be continuously running, and you put a sleep inside the code (This is my preferred method for external collectors). The scripts outputs the telnet format, or the undocumented JSON format to stdout. Scollector picks it up, and queues that information for sending.
I created an issue to get this documented not long ago https://github.com/bosun-monitor/bosun/issues/1225. Until one of us gets around to that, here is the PR that added JSON https://github.com/bosun-monitor/bosun/commit/fced1642fd260bf6afa8cba169d84c60f2e23e92
Adding to what Kyle said, you can take a look at some existing external collectors to see what they output. here is one written in java that one of our colleagues wrote to monitor jvm stuff. It uses the text format, which is simply:
metricname timestamp value tag1=foo tag2=bar
If you want to use the JSON format, here is an example from one of our collectors:
{"metric":"exceptional.exceptions.count","timestamp":1438788720,"value":0,"tags":{"application":"AdServer","machine":"ny-web03","source":"NY_Status"}}
And you can also send metadata:
{"Metric":"exceptional.exceptions.count","Name":"rate","Value":"counter"}
{"Metric":"exceptional.exceptions.count","Name":"unit","Value":"errors"}
{"Metric":"exceptional.exceptions.count","Name":"desc","Value":"The number of exceptions thrown per second by applications and machines. Data is queried from multiple sources. See status instances for details on exceptions."}`
Or send error messages to stderror:
2015/08/05 15:32:00 lookup OR-SQL03: no such host

Resources