SNMP Traps handling

Started by calin.sarac, December 30, 2010, 01:56:03 PM

Previous topic - Next topic

calin.sarac

Hi!

As I can see from your config, you extract only one varbind from SNMP trap - with OID .1.3.6.1.4.1.2509.8.21.2.2.1.7. Value of this varbind will become event's parameter number 2, as you can see from column "No." in trap configuration's "Parameter buindings" list. But, in your event configuration and event processing policy you refer to parameter number 3 (by using macro %3 and variable $3 in script), which will always be empty string, because you don't extract anything else from trap. If you change $3 in your script to $2, it should start working.

Also, why you are using syslog parser? Do you receive anything via syslog as well?

Best regards,
Victor


First of all I changed $3 with $2 and it seems that it works.
Now regarding the syslog parser, the situation is like this. In one moment in the past I was not able to get alarm message in Alarm Browser. So as long as I didn't find in the documentation which files ar processed by syslog parser
I suposed that the  syslog parser process the default logs (like SNMP Trap log) and there for I tried to extract from SNMP Trap Log the message that contains string "201" and all that next (this because I observed that all messages contains the yaear 2010 or 2011), and for some reasons I belived that it really works. It is obviously that I was wrong. So now, what files are processed by syslog parser or which is the syntax that indicates the the file processed.
Anyway, problem solved,
Thanks a lot,
Calin

calin.sarac

Quote from: Victor Kirhenshtein on January 08, 2011, 07:00:24 PM
Quote from: calin.sarac on January 08, 2011, 09:44:48 AM
One question please, as long as  I was not able to execute comands or scripts from Actions section in your program could be there any connection with the present situation ?  I tried a simple command like "cmd.exe /C "mplay32"" and even it seems that is fine is not working.I tried to put the same command in a bat file and add that bat file in actions and still not working even if everything is fine (I read all your post on the forum regarding this subject and follow the recomandations).

If you are running NetXMS server as a Windows service, you will not see any GUI for the programs started by the server. If you really wish to see GUI program started by the server, you should turn on "Allow service to interact with desktop" in NetXMS Core service properties. For simple tests, I recommend you to start simple program or bat file which writes something to some file, and check content of that file.

Best regards,
Victor

I turned on "Allow service to interact with desktop" but still no result. I'm missing something but not sure what.
Thanks a lot
Calin

Victor Kirhenshtein

Did you try console programs as well (something very simple like cmd /c echo test > c:\test.txt)?

calin.sarac

Yes I tried, but nothing. Please take a look at attachements if you have time and tell me where I'm wrong.

kurt

i have the same issue.
I can see the processen in taskmanager but not in the desktop.
Interact with Desktop was actief, Tried even with my User account.
Running in windows 2003 Server

anyone any clue

thanks
Kurt

Victor Kirhenshtein

Quote from: calin.sarac on January 14, 2011, 04:19:26 PM
Yes I tried, but nothing. Please take a look at attachements if you have time and tell me where I'm wrong.

In action configuration, backslash character (\) is an escape character, so if you need it in resulting string, you should use two backslash characters. So, in your case you must write


cmd /c "echo test > c:\\test.txt"


Best regards,
Victor

kurt

Thanks, was one of the issues. :)