Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Filipp Sudanov

#256
General Support / Re: ZFS FileSystem
January 10, 2025, 04:29:52 PM
Quote from: rainerh on January 09, 2025, 05:57:21 PMconsole output:
root@pve110:~# zpool status rpool | grep -E "raid|mirror" | awk '{print $2}'
ONLINE
root@pve110:~# zpool status datastore01 | grep -E "raid|mirror" | awk '{print $2}'
ONLINE

NetXMS output:
zpoolStateRAID(datastore01) =   raidz2-0                                      ONLINE      0    0    0
zpoolStateRAID(rpool) =   mirror-0                                          ONLINE      0    0    0
looks like awk part did not work at all. How is it specified in agent config file, could be some issue with quotes.
You can also do something like this:
zpool status datastore01 | grep -E "raid|mirror" | tr -s " " | cut -d" " -f 4Another option is to have all the command in a separate .sh file and just call that.

For zpool_influxdb, may be adding --no-histogram will print less lines. Also looks cumbersome to parse, you can try something like this:

zpool_influxdb | "vdev=root/raidz-0\ " | cut -d',' -f 3 | cut -d'=' -f 2
If you can extract names of HDDs from it's output, you can use that as external list (https://netxms.org/documentation/adminguide/agent-management.html#externallist) - this way you could create DCIs automatically for HDDs.

#257
General Support / Re: ZFS FileSystem
January 09, 2025, 05:41:52 PM
By the way, can you show what ouput zpool_influxdb command produces on your system? It's written that it has machine-readable format, but I was not able to find an example of output.
#258
Hi,

I did a quick check - looks that it works in 5.1.1 and does not in 5.1.2. Will check with developers.
#259
General Support / Re: ZFS FileSystem
January 08, 2025, 01:29:05 PM
Currently you can configure something like
ExternalMetric=zpoolState:zpool status | grep "state: .*"
in agent configuration file. This will add zpoolState metric, which would return e.g. " state: DEGRADED", your add something after grep to cut "state: " part.
It's also possible for the metric to have a parameter, which will be given to the executed command
ExternalMetric=zpoolState(*):zpool status $1 | grep "state: .*"
this way you can get value of zpoolState(POOL_NAME)


In the future - ZFS v 2.3. will support json output (https://github.com/openzfs/zfs/issues/2626). And in v. 5.2. of NetXMS we will have new external parameter mechanism that parses json, xml and plain text, so all that can be used to get zfs state.
#260
Пакеты для raspberry как-то редко требуются, у нас система сборки в какой-то момент сломалась и ее пока не починили. В какой-то момент починим, на сейчас последнее что есть это 4.1.420 под buster (https://packages.netxms.org/raspbian/pool/buster/main/n/netxms/), но можно попробовать, поменяв в /etc/apt/sources.list.d/netxms.list bookworm на buster, может быть он и встанет на bookworm.


#261
Checked with developers, currently this is not supported. Aggregation settings currently only affect data collection on clusters.
However, the code that displays the chart goes through all table rows anyway, so it will be a small change to add this. 
There's no exact time frame when it will be done, but you can follow the ticket to get notified: https://track.radensolutions.com/issue/NX-2671

#262
General Support / Re: Scripted Pie Chart Example
December 08, 2024, 02:28:13 PM
Scripted bar or pie charts either accept array with values:
return [1,2,3];

or hashmap, which allows to provide names in additions to values:
v = %{};
v["name1"] = 1;
v["name2"] = 2;
v["name3"] = 3;
return v;

Functions to get DCI values are described here https://www.netxms.org/documentation/nxsl-latest/#func-getdcivaluebyname
I can provide a detailed example of how to use them in the coming days (you can give some details on what data do you need)
#263
General Support / Re: Correlate events using EPP?
November 28, 2024, 02:50:08 PM
This was intended to be done in Hook::EventProcessor hook script, that is executed before event is processed through EPP rules. But most probably this would also work from a EPP rule. 

This will set "correlated" flag on the event and EPP rules will not react to that event (except for the rules, which have "accept correlated events" checkbox set. 
If you have an alarm originating from the "main" event, then in details of that alarm you should see hierarchy of events.
#264
Yes, it needs a bit of regex, please try to import attached configuration. 
At some point we will include this into out-of-the-box object tools
#265
Subnets are created on node configuration poll. Possible reason could be some node(s), which have interfaces with periodically changing IP address.
Filtering can be done in Hook::CreateSubnet script in script library, but first of all you can add some debug there (before "return true;" line):

trace(0, "In Hook::CreateSubnet | Conf poll on " .. $node.name .. " want to create subnet " .. $1.ipAddress);

This will add messages to server's log. If you NetXMS version is older then 5.x, line should be a bit different:

trace(0, "In Hook::CreateSubnet | Conf poll on " . $node.name . " wants to create subnet " . $1.ipAddr);
#266
General Support / Re: Windows events not sync
November 05, 2024, 10:16:15 AM
To clarify this - we have two ways of dealing with windows event logs
- logwatch
- wineventsync

Logwatch supports parsing of offline events, while wineventsync currently does not. There is an issue in our bug tracker on this, so some day this will be fixed: https://track.radensolutions.com/issue/NX-1997
#267
General Support / Re: MQTT with json format
November 04, 2024, 12:31:29 PM
Version is fine, last changes in mqtt were somewhere in 4.x, so any 5.x version has the latest and greatest code.

If you node where you have this agent is not your netxms server and not zone's proxy, try setting the node itself as MQTT proxy in it's properties.
#268
General Support / Re: MQTT with json format
November 04, 2024, 11:55:43 AM
Or just
[MQTT/Brokers/Test]
Hostname = y.y.y.y
if using default port number.

First thing to check if mqtt subagent actually loads during agent start. This is visible in agent log, e.g.:
2024.11.04 11:43:11.911 *I* [subagents          ] Subagent "MQTT" (/opt/netxms-master/lib/netxms/mqtt.nsm) loaded successfully (version 5.1.0-rc326)
On Linux you might need to install netxms-agent-mqtt package as mqtt subagent is in it.

Then a bit tricky part is if using MQTT origin, server tries to get the value from agent which runs along with your server (or agent which is zone proxy, if node where DCI is configured is in some zone). This is the same logic as for ssh monitoring. The idea is that you might have a node (or sensor) object which corresponds to your mqtt device and you have DCIs on it, but data collection happens through agent on another node. You can explicitly specify MQTT proxy in node or sensor properties.

You can enable DebugLevel=6 in agent config, the you should see lines like this:

2024.11.04 09:53:27.692 *D* [comm.cs.2          ] Requesting metric "MQTT.TopicData("test:metrics/grid/voltage/L2")"
2024.11.04 09:53:27.693 *D* [mqtt               ] Subscribed to topic metrics/grid/voltage/L2 on MQTT broker 127.0.0.1:1883

...

2024.11.04 09:54:26.671 *D* [mqtt               ] MQTT message received: metrics/grid/voltage/L2="456"


#269
General Support / Re: MQTT with json format
November 01, 2024, 04:57:09 PM
This is interesting, seems that json payload is a popular thing these days.

Unsupported could be in case if agent subscribed to topic, but there is no new value on the broker. I've used similar config as what you have and once I've pushed a new value with mosquitto_pub, I can get value of "Volt" from the agent - whole contents of the json appears in last values on the server.

Max length of DCI value is 255 chars, so if you payload is within that, you are lucky. Ideally agent could parse the payload, I've added ticker for that: https://track.radensolutions.com/issue/NX-2626

Now, in transformation script you can parse the json and extract your value:
j = JsonParse($1);
if (j == null) return null;
value = j.get("value");
return value;


P.S. It's not necessary to specify metrics in agent config - you can use MQTT origin, in this case agent automatically subscribes to topics. I've updated the documentation on this.
#270
Но вообще-то это довольно типичная ситуация, мы подумаем, может быть добавим какой-то специальный список сабнетов, для которых дубликаты будут игнорироваться