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 - Borgso

#31
General Support / Re: Agent Policies - File Delivery
February 04, 2020, 02:09:28 PM
I have attached.
As you can see, i create "TestFileDelivery" File Delivery Policy with folder "test"
When adding/upload files from local machine, nothing seems to happen after i have found file on disk and doing the add.
I do not see any errors in netxmsd.log when adding file

When running Force deployment, this is in log:
Quote2020.02.04 13:07:32.654 *D* [client.session.0   ] Received message CMD_POLICY_FORCE_APPLY
2020.02.04 13:07:32.654 *D* [client.session.0   ] Sending message CMD_REQUEST_COMPLETED (32 bytes)
2020.02.04 13:07:32.655 *D* [                   ] Job 45842 added to queue (node=3636, type=DEPLOY_AGENT_POLICY, description="Deploy policy TestFileDelivery")
2020.02.04 13:07:32.656 *D* [                   ] Template::forceApplyPolicyChanges(001-docker11): "TestFileDelivery" policy deploy scheduled for "001-docker11" node
2020.02.04 13:07:32.656 *D* [client.session.0   ] Sending compressed message CMD_JOB_CHANGE_NOTIFICATION (128 bytes)
2020.02.04 13:07:32.656 *D* [                   ] Job 45842 started
2020.02.04 13:07:32.803 *D* [node.agent         ] Node::createAgentConnection(001-docker11 [3636]): conn=0x7fb1360bc1c0
2020.02.04 13:07:32.803 *D* [agent.policy       ] FileDeliveryPolicy::deploy(001-docker11 [3636] from TestFileDelivery/TestFileDelivery):)
2020.02.04 13:07:32.803 *D* [agent.policy       ] FileDeliveryPolicy::deploy(001-docker11 [3636] from TestFileDelivery/TestFileDelivery): preparing file list
2020.02.04 13:07:32.828 *D* [                   ] Job 45842 finished, status=COMPLETED
2020.02.04 13:07:32.828 *D* [client.session.0   ] Sending compressed message CMD_JOB_CHANGE_NOTIFICATION (144 bytes)

Same after upgrading everyting to latest

NetXMS Server 3.1.343 - Ubuntu LTS 18.04.3
NXMC 3.1.343 - Windows 10
nxagent 3.1.343 - Ubuntu LTS 18.04.3
#32
General Support / Re: Agent Policies - File Delivery
January 31, 2020, 08:54:19 PM
Thanks for reply, i forgot to add os.

NetXMS Server 3.1-300 - Ubuntu LTS 18.04.3
NXMC 3.1.343 - Windows 10
nxagent 3.1-300 - Ubuntu LTS 18.04.3

Tried with your suggested settings, but still can't see any files on agent or in the NXMC dir after uploading to policy.
Im able to browse Node "File manager", upload files there and delete. So settings should be ok at Agent side.
#33
General Support / Agent Policies - File Delivery
January 31, 2020, 09:16:24 AM
Hi

Im trying to understand Agent Policies - File Delivery.
Documentation is empty on the topic: https://www.netxms.org/documentation/adminguide/agent-management.html#file-delivery-policy

Im able to create a policy and add "dir".
But when adding a file, nothing seems to happen.

Is there anything required on agent or server to get this function work?

NetXMS Server 3.1-300
NXMC 3.1.343
nxagent 3.1-300
#34
Sorry, my bad.
I forgot "make" part after "./configure" and before "make install"
#35
Hi.

While waiting for a maintained RPi packages, im building agent from source on RPi.
Using something like this to get the latest version built:

sudo apt-get install -y links libssl-dev build-essential
MAJOR=$(links -dump "https://www.netxms.org/download/releases/" | egrep "([0-9]+\.[0-9])"  | awk '{print $1}' | cut -d "/" -f1 | tail -n1)
MINOR=$(links -dump "https://netxms.org/download/releases/$MAJOR" | sed 's/[^0-9.]*\([0-9.]*\).*/\1/' | egrep -v "^$|^\." | sort -t. -k3,3n | tail -n1 | sed 's/\.$//')

echo "Create build folder"
mkdir ~/NetXMS
cd ~/NetXMS
wget --no-check-certificate https://www.netxms.org/download/releases/${MAJOR}/netxms-${MINOR}.tar.gz

echo "Unpack source to clean folder"
if [ -d netxms-${MINOR} ]; then rm -rf netxms-${MINOR}; fi
tar -zxvf netxms-${MINOR}.tar.gz
cd netxms-${MINOR}

./configure --with-agent --without-curl --disable-ssh --disable-mqtt --prefix=/opt/nxagent
make
RETURN_CODE=$?

if [ $RETURN_CODE -gt 0 ]; then
    echo "Something bad happen: $RETURN_CODE"
    exit
fi

echo "Stop current"
sudo systemctl stop nxagentd

echo "Make install"
sudo make install
RETURN_CODE=$?

if [ $RETURN_CODE -gt 0 ]; then
    echo "Something bad happen: $RETURN_CODE"
    exit
fi

sudo cp contrib/startup/systemd/nxagentd.service /etc/systemd/system/
sudo systemctl enable nxagentd
#36
Hi and thank for reply.

I tried what you suggest, but it doesnt work as before:

ServiceName is username within /etc/passwd catched using ExternalList on the node.

Does not work:
if ($node->isAgent && $node->platformName like "Linux-*") {
    users = $node->readAgentList("UserList");
    if ( users == null ) return null;
    foreach ( user : users ) {
      if ( user == ServiceName ) return true;
    }
  }
  return false;


Does work, but is not the correct way..
if ($node->isAgent && $node->platformName like "Linux-*") {
    users = AgentReadList($node,"UserList");
    if ( users == null ) return null;
    foreach ( user : users ) {
      if ( user == ServiceName ) return true;
    }
  }
  return false;



However, if i add node to template first and then do "Configuration Poll" with $node->readAgentList version, it does not remove the node from template even if "Remove this template automatically when node no longer passes through filter"
It does get removed/unbind if i only put "return false;" in the Automatic Apply Rules.
#37
Have been using AgentReadList in different scenarios to dynamic apply template and dci instances
Could need some help to get it rewritten for NXLSv3


What worked in 2.2.x

Scenario 1:

DCI on agentless node, using a "source node" and "Instance discovery method: Script", called with
QuoteDW::DiscoverActiveMQ("DLQDetailsQueue")

DW::DiscoverActiveMQ script is:
if ($1 == "ActiveMQ") {
  //return AgentReadList($node, "DiscoverActiveMQ(" . $targetObject->ipAddr . ")");
  return $targetObject->readAgentList("DiscoverActiveMQ(" . $targetObject->ipAddr . ")");
}


ExternalList DiscoverActiveMQ do a do a call from source node to node and get a instance list to create DCI to poll info using a ExternalParameter (script on source node -> node) on each instance.




Scenario 2:
AutoApply template if user X is within /etc/passwd.

Using a script library with following code and "ExternalList = UserList:cut -d: -f1 /etc/passwd"
sub ServiceCheck(ServiceName) {
  if ($node->isAgent && $node->platformName like "Linux-*") {
    users = AgentReadList($node,"UserList");
    if ( users == null ) return null;
    foreach ( user : users ) {
      if ( user == ServiceName ) return true;
    }
  }
  return false;
}
#38
General Support / Re: NXLS state and runtimeFlags in v3.0
September 30, 2019, 09:46:39 AM
Thanks for the clarifications, this helped me alot :)
#39
General Support / NXLS state and runtimeFlags in v3.0
September 28, 2019, 10:32:39 AM
Hi

After upgrading from 2.2.17 to 3.0.2292 runtimeFlags and state in NXLS does not show correct values.

Debugging with a Dummy dci on nodes and return $node->runtimeFlags + $node->state gives this results:

Node with active alarm, not responding to ICMP (dead) and only ICMP poll:
$node->runtimeFlags = 4
$node->state = 5

Node with no active alarm, responding to ICMP and only ICMP poll :
$node->runtimeFlags = 4
$node->state = 4

Node with no active alarm, responding to ICMP and nxagent+ICMP poll:
$node->runtimeFlags = 4
$node->state = 0

How can i stable check whetever Node is dead or not within NXLS?
We are using this on dummy/external+proxy DCI's to prevent them raising alarms when node is dead(not responding to ICMP or Agent)

We used this before:
Quoteif ($node->runtimeFlags & 0x0004) {
    return true;
}
#40
General Support / Re: Websvc problem in 3.0
September 24, 2019, 11:06:26 PM
Thanks!
Confirmed working again  8)
#41
General Support / Websvc problem in 3.0
September 24, 2019, 11:17:21 AM
Hi

Im having problem with Websvc API after upgrading to v3
This works in 2.2.17, but fails in v3 with response code 404 in catalina.out.

https://www.netxms.org/documentation/adminguide/advanced.html#get-object-by-id
curl -X GET --cookie "session_handle=$SESSION_HANDLE" "$API_HOME/objects/1579"

Did anything change in API?

This still works:
https://www.netxms.org/documentation/adminguide/advanced.html#get-multiple-objects-with-filters
curl -X GET --cookie "session_handle=$SESSION_HANDLE" "$API_HOME/objects?class=container,node"
#42
I can confirm adding "--add-modules java.xml.bind" to JAVA_OPTS in /etc/default/tomcat8 works for "openjdk 10.0.2" and tomcat8
#43
General Support / Re: Upgrade Failed
February 21, 2018, 08:57:01 AM
Thanks for clarify, fair enough reason ;)

Was running SQLite on a Test/Demo server (proof of concept) because it was fast and easy to rollback/maintaine
But as i now understand the problem i will migrate to another DB
#44
General Support / Re: Upgrade Failed
February 20, 2018, 08:30:46 AM
Found a bug report for this: https://track.radensolutions.com/issue/NX-1377
#45
General Support / Re: Upgrade Failed
February 19, 2018, 11:26:13 PM
Having the same problem with SQLite as Database.

Starting with upgrade to 2.2.x series.
After "nxdbmgr upgrade -X" i get server up and running but without any nodes and this in log

QuoteSQL query failed (Query = "INSERT INTO nodes (primary_ip,primary_name,snmp_port,node_flags,snmp_version,community,status_poll_type,agent_port,auth_method,secret,snmp_oid,uname,agent_version,platform_name,poller_node_id,zone_guid,proxy_node,snmp_proxy,icmp_proxy,required_polls,use_ifxtable,usm_auth_password,usm_priv_password,usm_methods,snmp_sys_name,bridge_base_addr,down_since,driver_name,rack_image_front,rack_position,rack_height,rack_id,boot_time,agent_cache_mode,snmp_sys_contact,snmp_sys_location,last_agent_comm_time,syslog_msg_count,snmp_trap_count,node_type,node_subtype,ssh_login,ssh_password,ssh_proxy,chassis_id,port_rows,port_numbering_scheme,agent_comp_mode,tunnel_id,lldp_id,fail_time_snmp,fail_time_agent,runtime_flags,rack_orientation,rack_image_rear,id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"): table nodes has no column named rack_image_front