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

#76
General Support / Actions - Parameter?
June 26, 2009, 09:38:26 AM
Hi all,

Having defined several actions, I was wondering whether there is a way to define actions (remote or not) in the server related panel to which some parameters could be given when called through an event policy.

That would be very interesting as a defined action could be so generic that it would be called in several events but with different parameters. Example, a script "start_process.pl" to which you would give the process name and the user whose rights shall be used to start it. You may also want to provide the remote node name on which to start this process...

Cheers,
Jdamien
#77
Hi all,

Would be nice if some one could explain how the logwatch actually works.
Is it polling the log file regularly (i.e. every X sec.) or does it somehow detects that log file has been modified and immediately react by parsing what has been added?

In fact: how often is the log file scrutinized? What is the trigger for the parser to treat what has been added to the log file?

This is interesting info to understand how implemented monitoring will work.

Best regards,
JDamien
#78
Well as I managed to get through some of this by myself, I'm summarizing a small "HowTo" so you can as well enjoy...

Actions
Actions can be defined on the server using the panel "Actions". Very easy, one shall only follow the kind of wizard.
So far I only used the sending of email for which one shall not forget to define both SMTP server (SMTPserver parameter) and server email address (SMTPFromAddr parameter)

Using the macros provided on the last page of the user manual, one can easily format both email content and subject.

Note, if you want to put several email addresses for destination, use the ";" to separate them. Funny is that as recipient you don't see who else has received the email from NetXMS.

ExternalParameter and ExternalParameterShellExec
The difference is explained somewhere in the forum or user manual. The ShellExec is to be used for those processes or parameters that are interpreted by some additional process: bash, perl or the like.

Then in your agent configuration file (pay attention to respect the declaration order see Log Parser issue in this forum) you define the script you want to run and that is providing the data which will be collected to get graphed or monitored in order to generate alarms.

Syntax is:
ExternalParameterShellExec=<data_collection_name>{(*)}: <script_path> {$1} {$2} .. {$i}
where <data_collection_name> will be your reference to be used in the data collection definition in NetXMS console, you will have to append (*) to the name if you have parameters to provide. Those parameters are represented by the optional $1, $2... $i. As many as you have parameters.

So example:
ExternalParameterShellExec=my_data_coll(*): /home/netxms/my_mon_script.pl $1 $2
This states that you will provide 2 parameters to the script my_mon_script.pl in the data collection definition

Pay attention that in bash the value is returned using echo which in perl, this value is returned by printing out to the standard output. Do not use exit or return.

Pay attention... starting your script by /usr/bin/perl my_mon_script.pl will not call a bash... while ./my_mon_script.pl does! Taouw... as Homer says :o

Data collection
Now in NetXMS console you want to define the data collection based on this script.

You will have to select the NetXMS Agent as origin and insert your <data_collection_name> which by the way you will not find in the available list. I did not try but I would suggest not to use any existing data collection name... Possible conflict or simply possible problem easy to avoid - play it safe and simple ;-)
There enter as well your parameter(s) if any required.
Up to you to tweak / transform the data or define your threshold.

Hope this helps
Regards,

Jdamien

----

Update, Alex: see also http://wiki.netxms.org/wiki/ExternalParametersProvider
#79
Hehehe  ;D I found the fix...

I'm sure many will come across that one as well so hope you'll find this post quickly and not waste too much of your time on this issue.

Well basically, it is just about defining the things according to a certain order in the agent config file. Unfortunately I cannot explain why but probably our NetXMS gurus will do later on...

This is how I defined it in my agent config file.
The only difference is that ExternalParameterShellExec is defined RIGHT after the subagent declaration. Then and only then comes the logwatch subagent declaration.

Agent config file extract:
SubAgent = /usr/local/lib/libnsm_linux.so
ExternalParameterShellExec = TCP.SocketStatus(*):/home/netxms/scripts/socket_status.pl $1 $2

SubAgent = /usr/local/lib/libnsm_logwatch.so
*LOGWATCH
Parser = /home/netxms/parser/log_parser_n2p.xml


Agent log file extract:
[19-Jun-2009 15:57:39] Log file opened
[19-Jun-2009 15:57:39] Debug: Log file opened
[19-Jun-2009 15:57:39] Debug: Subagent API initialized
[19-Jun-2009 15:57:40] Subagent "/usr/local/lib/libnsm_linux.so" loaded successfully
[19-Jun-2009 15:57:40] Subagent "Linux" already loaded from module "/usr/local/lib/libnsm_linux.so"
[19-Jun-2009 15:57:40] Debug: LogWatch: registered parser for file /home/dk/out.txt, trace level set to 0
[19-Jun-2009 15:57:40] Subagent "/usr/local/lib/libnsm_logwatch.so" loaded successfully
[19-Jun-2009 15:57:40] Debug: LogParser: parser thread for file "/home/dk/out.txt" started
[19-Jun-2009 15:57:40] Debug: LogParser: file "/home/dk/out.txt" successfully opened
[19-Jun-2009 15:57:41] Debug: Trying to bind on 0.0.0.0:4700
[19-Jun-2009 15:57:41] Listening on socket 0.0.0.0:4700
[19-Jun-2009 15:57:42] NetXMS Agent started
...


Hope this will be of any value to someone else.

Regards & Have fun
Jdamien
#80
General Support / Re: Duplicate nodes
June 19, 2009, 01:07:55 PM
Sad to say but for the moment the solution I decided to take was...
connect to MYSQL
DROP DATABASE netxms;
REVOKE... to netxms...
And recreate from scratch the DB...

I would appreciate to get some feedback on an alternative solution 'cause you lose all your config/job there!

Damned! What did I do wrong? Happily I was only starting...
Have a nice day
Regards,
#81
General Support / Re: Duplicate nodes
June 19, 2009, 11:39:11 AM
More over, I seem to be unable to delete any of those nodes... My console gets stuck and have to restart it.
When I restart my server with DB check requested here is what I get...

NetXMS Database Manager Version 0.2.26

Configuration file OK
Checking database:
Unlinked node object 603 ("40.16.1.2"). Delete? (Y/N) Y
Unlinked node object 604 ("40.16.1.2"). Delete? (Y/N) Y
Unlinked node object 605 ("40.16.1.2"). Delete? (Y/N) Y
Unlinked node object 606 ("40.16.1.2"). Delete? (Y/N) Y
Unlinked node object 607 ("40.16.1.2"). Delete? (Y/N) Y
Unlinked node object 608 ("40.16.1.2"). Delete? (Y/N) Y
Unlinked node object 609 ("40.16.1.2"). Delete? (Y/N) Y
Unlinked node object 610 ("40.16.1.2"). Delete? (Y/N) Y
Unlinked node object 611 ("40.16.1.2"). Delete? (Y/N) Y
* Checking node objects...                                              [FIXED ]
Unlinked interface object 531 ("hme0"). Delete? (Y/N) Y
Unlinked interface object 532 ("hme0:1"). Delete? (Y/N) Y
Unlinked interface object 533 ("hme2"). Delete? (Y/N) Y
Unlinked interface object 534 ("hme1"). Delete? (Y/N) Y
Unlinked interface object 535 ("clprivnet0"). Delete? (Y/N) Y
* Checking interface objects...                                         [FIXED ]
* Checking network service objects...                                   [PASSED]
* Checking cluster objects...                                           [PASSED]
* Checking template to node mapping...                                  [PASSED]
* Checking object properties...                                         [PASSED]
* Checking event processing policy...                                   [PASSED]
* Checking collected data...                                            [PASSED]
14 errors was found, 14 errors was corrected
All errors in database was fixed
Commit changes (Y/N) Y
Committing changes...
Changes was successfully committed to database
Database check completed

Regards,
Jdamien
#82
General Support / Duplicate nodes
June 19, 2009, 11:34:37 AM
Hi,

Strangely I start to have my nodes duplicated in the NetXMS console...
My NetworkRunDiscovery parameter is set to "1".

Anything special I should do?
Strangely not all nodes are duplicated...
regards,
#83
Hi,

It seems I have some conflict between the log parser and the ExternalParameter definition in a node configuration.
could you, please, let me know if I do sth wrong here?

Here is the agent log file when the following ExternalParameterShellExec is defined:
ExternalParameterShellExec = TCP.SocketStatus(*):/home/netxms/scripts/socket_status.pl $1 $2 $3 $4

Log file content:

[18-Jun-2009 17:21:41] Debug: Executing action Agent.Restart of type 2
[18-Jun-2009 17:21:41] Debug: EXEC: Expanding command ""/usr/local/bin/nxagentd" -c "/etc/nxagentd.conf" -d -D -X 12677"
[18-Jun-2009 17:21:41] Debug: EXEC: Executing ""/usr/local/bin/nxagentd" -c "/etc/nxagentd.conf" -d -D -X 12677"
[18-Jun-2009 17:21:41] Debug: {1} Sending message CMD_REQUEST_COMPLETED (size 32)
[18-Jun-2009 17:21:41] Debug: {1} Session with 10.10.64.125 closed
[18-Jun-2009 17:21:41] Debug: Trap sender thread terminated
[18-Jun-2009 17:21:41] Debug: {0} Session with 10.10.64.125 closed
[18-Jun-2009 17:21:42] Debug: Session Watchdog thread terminated
[18-Jun-2009 17:21:42] Debug: Listener thread terminated
[18-Jun-2009 17:21:42] NetXMS Agent stopped

[18-Jun-2009 17:21:43] Log file opened
[18-Jun-2009 17:21:43] Debug: Log file opened
[18-Jun-2009 17:21:43] Debug: Subagent API initialized
[18-Jun-2009 17:21:44] Subagent "/usr/local/lib/libnsm_linux.so" loaded successfully
[18-Jun-2009 17:21:44] Initialization of subagent "/usr/local/lib/libnsm_logwatch.so" failed
[18-Jun-2009 17:21:45] Debug: Trying to bind on 0.0.0.0:4700
[18-Jun-2009 17:21:45] Listening on socket 0.0.0.0:4700
[18-Jun-2009 17:21:46] NetXMS Agent started
[18-Jun-2009 17:21:49] Debug: Incoming connection from 10.10.64.125
[18-Jun-2009 17:21:49] Debug: Connection from 10.10.64.125 accepted
[18-Jun-2009 17:21:49] Debug: {0} Received control message CMD_GET_NXCP_CAPS
[18-Jun-2009 17:21:49] Debug: {0} Sending message CMD_NXCP_CAPS (size 16)
[18-Jun-2009 17:21:49] Debug: {0} Received message CMD_KEEPALIVE



One can easily see that logwatch subagent fails to initialize
If I remove the ExternalParameterShellExec fro mteh config file (commented out) here is the outcome:

[18-Jun-2009 17:24:18] Debug: EXEC: Executing ""/usr/local/bin/nxagentd" -c "/etc/nxagentd.conf" -d -D -X 13173"
[18-Jun-2009 17:24:18] Debug: {1} Sending message CMD_REQUEST_COMPLETED (size 32)
[18-Jun-2009 17:24:18] Debug: {1} Session with 10.10.64.125 closed
[18-Jun-2009 17:24:18] Debug: Trap sender thread terminated
[18-Jun-2009 17:24:18] Debug: {0} Session with 10.10.64.125 closed
[18-Jun-2009 17:24:19] Debug: Session Watchdog thread terminated
[18-Jun-2009 17:24:19] Debug: Listener thread terminated
[18-Jun-2009 17:24:19] NetXMS Agent stopped

[18-Jun-2009 17:24:20] Log file opened
[18-Jun-2009 17:24:20] Debug: Log file opened
[18-Jun-2009 17:24:20] Debug: Subagent API initialized
[18-Jun-2009 17:24:21] Subagent "/usr/local/lib/libnsm_linux.so" loaded successfully
[18-Jun-2009 17:24:21] Debug: LogWatch: registered parser for file /home/dk/out.txt, trace level set to 0
[18-Jun-2009 17:24:21] Subagent "/usr/local/lib/libnsm_logwatch.so" loaded successfully
[18-Jun-2009 17:24:21] Debug: LogParser: parser thread for file "/home/dk/out.txt" started
[18-Jun-2009 17:24:21] Debug: LogParser: file "/home/dk/out.txt" successfully opened
[18-Jun-2009 17:24:22] Debug: Trying to bind on 0.0.0.0:4700
[18-Jun-2009 17:24:22] Listening on socket 0.0.0.0:4700

Subagent logwatch successfully loaded.
Here is the config for the logwatch:

SubAgent = /usr/local/lib/libnsm_logwatch.so
*LOGWATCH
Parser = /home/netxms/parser/my_script_out.xml


Many thanks in advance fro your support.
Best regards,

Jdamien
#84
Feature Requests / Re: Filter for events...
June 17, 2009, 03:22:13 PM
I'm really looking forward to see your new console!
I read somewhere in the forum that it will be Eclipse / Java based... just an opinion: high-end Web-based console would be wonderful!

As you clearly mentioned it: we just have to be patient.

Regards,
Jdamien
#85
Feature Requests / Filter for events...
June 17, 2009, 11:43:12 AM
Hi,

It would be user-friendly to get some kind of filtering option in actions, events, events processing windows (etc).
Indeed, for example, if you define your way to name events according to systems or projets, when working on a topic, this filter would allow you to filter and only see those events you are interesting in for current work.

I can imagine an operational NetXMs system with 1000's of events, actions, processing rules... so this feature might then be quite useful for admin.

What's your opinion on that one?

Best regards,
Jdamien

PS.: The more I get to know your tool the greater it looks to me... I would however strongly advise/appreciate if documentation could be less generic, with examples, more complete basically.
#86
General Support / Variables / Subagents list
June 12, 2009, 05:44:06 PM
Hi,

could you, please, provide us with the list of existing sub agents (+ functionality) and of the variables available in the different sectors of NetXMS?

For example:
%OBJECT_IP_ADDRESS% for example used in "Object tools"...
isAgent, isSNMP, ...

Thanks
Jdamien
#87
General Support / Object tools - SNMP Table
June 12, 2009, 05:38:38 PM
Hi,

In this object tools panel, select "new", create an "SNMP table".
Fill in first tab "General" and give access. Then select in "options" tab that SNMP must be supported...

And finally try to fill in the table in "Columns" tab.
None of the button allows you to do so: "add"...
Nothing happens... Bug? Or do I do sth wrong?

Regards,
#88
General Support / Object tools "&"
June 12, 2009, 05:33:19 PM
Hi,

Simple one... what is the use of "&" character in the object tool / name?
I guess some kind of shortkey or so... but nothing.

I got that "->" allows one to create menu trees.

Thanks in advance
Regards,

Jdamien
#89
Dear all,

Could some one, please, elaborate a bit on how to configure AND use "Action", "ExternalParameter" and "ExternalParameterShellExec"?
The available documentation presents a "dead loop" in section "Agent configuration" pointers are pointing to this same section for more details...
Unfortunately, I did not find any complete explanation on this forum though there are some very interseting topics.

Many Thanks in advance for your help/support. ;D

Expected info:
- Syntax for action definition in nxagentd.conf (not in doc)
- How to use returned / collected info in NetXMS console for both action and external parameter

A nice way would be to explain how to - for example - execute a script or system command (ping, ps or netstat), extract some info after treatment of the output (grep, wc, cut, sed and the like), define event and threshold related to returned info.

Suggestion: copy/past your contribution to the user manual  ;)

#90
Hi there,

Could you, please, let us know what is the status on this one?
Do you plan to deliver a new release? When? Thanks.

regards,
Jdamien