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

#16
General Support / Re: Script for synology NAS
December 13, 2018, 12:01:48 AM
My guess is that raid_Status is NULL or some other value that does not match any of the cases.

To catch this, add
    default:
      evt = "SYNOLOGY_RAID_STATUS_ERROR";
      details = "NO_STATUS";


Assuming that allows the script to run, check that "raidStatus" is the Parameter and not the Description for the DCI you are getting the value from.
Possibly the script is not being run on the node where the "raidStatus" DCI is located.
#17
Seems if maint_event_id is greater than 0 the object is in maintenance mode. Looks like they are keeping track of more than a "yes/no" as just entering maintenance mode gives a value of 6335951 and if the object is scheduled for maintenance the value is 6335955.
#18
Here is the Hook:CreateInterface script in the script library that I use to give you an idea:

if ($1->name ~= "(?i).*Teredo.*|.*isatap.*|.*Loopback.*|.*Bluetooth.*|Local Area Connection\* 12|Local Area Connection\* 11|Local Area Connection\* 9|Local Area Connection\* 8|Local Area Connection\* 2|6TO4 Adapter|sit0") {
   return false;
} else {
   return true;
}


You could add in tun1 to that list or whatever names you do not want to create.
#19
General Support / Re: Syslog in 2.2.10
November 05, 2018, 10:35:58 PM
I am fairly certain you will need a third party utility to send Windows Event logs to NetXMS in syslog format.

Here is my understanding of the two parsers.

On the agent, the parser (which is the *LOGWATCH) will look at the configured log and send a message for the server to create a NetXMS Event (as in, the events configured under Configuration/Event Configuration). You will not see this under Monitor/Syslog as the message is not syslog. You would see this under Monitor/Events. In other words, *LOGWATCH does not generate syslog messages, it generates NetXMS Events.

On the server, the Syslog Parser will parse incoming syslog messages (which again, are not related to the above parser) and create a NetXMS event based on the criteria.

#20
General Support / Schedule Maintenance with a script
October 20, 2018, 12:13:24 AM
Is there a way to schedule maintenance on a node from a script (or another automated way to schedule maintenance)?

I want to automate putting the node into maintenance when a process has finished and closed, reboot the node, and then come out of maintenance an hour later. I can do everything I want except get the node out of maintenance.

Thank you

Gary
#21
Exactly what I needed. Thank you!
#22
I thought in previous versions when you right clicked a node and scheduled maintenance, the tasks would show in the Scheduled Tasks tab. I am not seeing them there anymore. It would be helpful if they were listed.

Thank you,
Gary
#23
In Configuration/Server Configuration, there is a setting for "ImportConfigurationOnStartup". Default is 1. Set this to 0. This is likely what is causing your issue.

You can export various components of your configuration using the Tools/Export Configuration option.

If you have a recent backup of your database you should be able to restore that and before starting NetXMS, change the "ImportConfigurationOnStartup" var_value in the config table from 1 to 0.
#24
General Support / Re: disable short unit
June 29, 2018, 03:58:41 PM
In the properties for the graph, there is a check box for "Use multipliers". Does that make the requested change?
#25
In the rule "id4768" you have 1 parameter. In your Event 100028 you can use %1 in the message and that will be whatever you matched on.

https://www.netxms.org/documentation/adminguide/log-monitoring.html#passing-parameters-to-events
#26
There are probably a few different ways to do this but this will get you started and you can expand from there.

1. Create the following script in the Script Library (Configuration/Script Library). Here I am assuming that you will have an event policy for each container and will create a script for each container. You could probably pass in the node, get the parent of the node, and use that as your start point so you could have just one script/event.

// Find Container by ID that needs shutdown and start enumeration from it. Replace nnnn with the ID of the container
EnumerateNodes(FindObject(nnnn));

// This function walks object tree recursively starting from given root
sub EnumerateNodes(rootObject)
{
// Walk all child objects
foreach(o : GetObjectChildren(rootObject))
{
if (classof(o) == "Node")
{
// Process node object
trace(1, "  + " . o->name);
if (o->isAgent == 1)
//Put the node into maintenance node
EnterMaintenance(o);
//Uncomment the next line to shutdown the systems
//AgentExecuteAction(o, "System.Shutdown");
//Use the below line to debug and make sure you are working with the intended nodes. You could also just use the Maintenance mode as an indication.
SetCustomAttribute(o, "TestShutdown", "Success");

}
else if (classof(o) == "NetObj")
{
// For all other objects, go down the tree
// There can be additional checks for object class, like
// if (o->type == 5)
EnumerateNodes(o);
}
}
}


2. Create an Actions Configuration (Configuration/Actions Configuration). Type will be Exectue NXSL script

3. Use the action in your Event Policy

I did basic testing, but nothing extensive. This is intended to get you started (although it may work for you as is).
If you want to test the script, you can use  Tools/Server Console and "exec <scriptname>".

If you have any questions or need further assistance, let me know.

Gary

#27
General Support / Schedule Node Restart
April 05, 2018, 07:55:48 PM
Is there a way to use Scheduled Tasks to schedule a reboot of a node that has the agent installed? I tried a script with $node -> agent.system.restart and just agent.system.restart which did not work. But that is the basic idea of what I want to do.

As an alternative, I was looking at scheduling a script to execute a command on the agent (Windows, so I would use shutdown.exe), but I do not see a way to accomplish this.

Finally, I think I could use Event Processing Policy, when device enters maintenance mode AND I have a unique identifier set (custom attribute) on the node I want to reboot, it will perform an action to restart the server. When node leaves maintenance, run a script to clear the unique identifier.

Those options are in order of what I think are the best ways to accomplish (if possible) what I want to do. Any suggestions on the first two or thoughts on the third one?

Thank you,

Gary
#28
It sounds like you have the same thinking with alarms as I did when first using NetXMS. If you want to know what time the alarm happened, you look in the event log. I used to keep all my alarms showing so i knew at what time something happened. But that quickly became cluttered. I now terminate all my alarms when the issue is resolved and check the event log for what time things happen. I think of alarms as the current state of the node and event log gives me the history of alarms. An easy way to see events for a node is to right click the node and choose Event Log.

If you want the alarm to stay. You need to configure Event Processing Policy from the Configuration menu. Sounds like there is a policy to terminate the alarm when the deactivation event is happening. Instead of terminate you could use resolve for the policy. That will leave the alarm, but show the node as healthy (not in alarm) and leave the alarm for manual review/termination.
#29
What device type? Windows? Linux? Switch/Router/Firewall?

The basic idea is that you will need to get the bandwidth for the interface. Which can be a hard coded value or perhaps gathered with Data Collection. You will then need a DCI to get the outbound traffic. In the Transformation section of the outbound traffic DCI put

(($1*8)/GetDCIValue($node,9363))*100

Where $1 is the current value gathered by the DCI, GetDCIValue is the DCI you created to gather the current bandwidth. $node means, you are looking at the current node for the DCI ID and the 9363 is an example of what the ID would for the bandwidth DCI. Or instead of GetDCIValue you could hard code it. A 1Gbps interface would be 1000000000.

To create alarms, use the Threshold section of the outbound traffic DCI. To configure events, use the Configuration/Event Configuration option from the main console. You will want to do that before you create the thresholds so the events will be available for selection in the Threshold

I hope that gets you started. There also could be other (better?) ways to do this. NetXMS is very configurable. If you have more questions, please ask and I will do my best to respond.



#30
General Support / Re: Agent Tunnel Port Configuration
February 28, 2018, 05:39:01 PM
I have tested this with agent 2.2.4 and was able to use ServerConnection = <server_ip>:<port> in the agent config.

Server side I needed to add the parameter (see below) to the config table using my database manager

AgentTunnelListenPort 443 1 1 I N Port server listens on for Agent Tunnels NULL 4703