newrelic-unix-monitor icon indicating copy to clipboard operation
newrelic-unix-monitor copied to clipboard

SmartOS zone support

Open ntEveryCity opened this issue 6 years ago • 4 comments

Hello

I am not really sure if this is the right place to ask. I have been trying to get this working with a SmartOS zone to monitor memory usage. To cut a long story short a new relic subscription was bought before I had a chance to investigate if it could work. I am now stuck trying to get this to work. Some things are working fine so not at all.

Can you please answer my question will this work for memory usage on a SmartOS zone or am I just banging my head against a brick wall.

Thank you

ntEveryCity avatar Feb 11 '19 18:02 ntEveryCity

As long as SmartOS can run a JVM, you could conceivably use this there. All it's doing is executing the commands you list in the config file at a command line, and parsing the results using regular expressions.

If things aren't working for you, have you tried debug mode to see what commands are running and how they're being parsed? https://github.com/newrelic/newrelic-unix-monitor/blob/master/README.md#debug-mode

sschwartzman avatar Feb 11 '19 19:02 sschwartzman

Hi sschwartzman

Thank you for the suggestion, I have enabled the debug mode but nothing extra is being printed to the logs. I have already found I have to use Solaris_10 as an OS type or solaris_11 is used as OS type. The problem with this is it is try to use top and this is not installed on the zone. In this setup top will produce results from the global zone and not the zone I am trying to monitor.

It would be useful to get the debug logs to see what is happening but nothing is being output. Do you have any suggestions?

Thank you

ntEveryCity avatar Feb 13 '19 12:02 ntEveryCity

Yeah, I left out one thing in the instructions, I need to update them. In addition to the debug setting in plugin.json, you'll need to change the log level in config/logback.xml from "INFO" to "DEBUG" in this line: <logger name="com.newrelic.infra.unix" level="INFO" additivity="false"> becomes <logger name="com.newrelic.infra.unix" level="DEBUG" additivity="false">

sschwartzman avatar Feb 13 '19 14:02 sschwartzman

Hi Seth

For interest I have written two new check for SmartOS zones. Before all checks where reporting global zone metrics

{ "eventType": "Stats", "command": "kstat -m memory_cap -c zone_memory_cap -s rss -p", "checkAllRegex": false, "lineLimit": 0, "mappings": [{ "expression": "memory_cap\D\d+\D+[0-9,a-z]+\D+[0-9,a-z]+\D+[0-9,a-z]+\D+[0-9,a-z]+\D+[0-9,a-z]+\D+\s(\d+)", "metrics": [{ "name": "rss.memory_usage_zone", "ratio": 1, "type": "NORMAL" } ] }] },

{ "eventType": "Stats", "command": "kstat -p -c zone_caps caps:28:swapresv_zone_28:usage -s usage", "checkAllRegex": false, "lineLimit": 0, "mappings": [{ "expression": "caps\D\d+\D+\d+\D+\s+(\d+)", "metrics": [{ "name": "swap.usage_zone", "ratio": 1, "type": "NORMAL" } ] }] },

Sorry about the formatting here but I am sure you get the idea. One note for the second check is the number 28 is the zone ID

ntEveryCity avatar Feb 27 '19 15:02 ntEveryCity