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 - Victor Kirhenshtein

#5626
Hi!

If you are not interested in checking that new content matches some exact text, but just to check for fact of change, then my proposed solution with diff thresholds will work. However, if you have to check that new content is available and matching some specific text/regexp, you have to create new DCI for each upcoming content change, and use advanced scheduling to execute it at specific time. With advanced scheduling, you will be able to execute the check at exact time or in given short interval. You can also use Java or C API to automate DCI creation if you have some external application which knows what the content will be.

Best regards,
Victor
#5627
General Support / Re: HP EVA integration
January 02, 2012, 12:16:42 PM
Hi!

The problem is that agent interprets last colon as a separator between script name and polling interval. It is not a problem on UNIX, but became a problem on Windows. Try to specify in config as:

ExternalParametersProvider = D:\topsec\hp_eva_collect_data.pl:60

(60 is a polling interval in seconds, you can change it to suit your needs). Then it should work.

Best regards,
Victor
#5628
General / Re: Java API
January 02, 2012, 11:41:37 AM
Hi!

Quote from: danieln on January 01, 2012, 05:12:18 PM
1. My main goal is to be able to push events from a java application into the NMS. As my java application emits JMX notifications, I want to catch them and using your java-api send a status event to netxms. Do you consider that a valid solution? Is there an online example of java api use for statuses and events?

Yes, this is a valid solution. There are no online examples, but you can use Junit tests in Java API source tree as examples of how to do simple operations with Java API. And feel free to ask any questions regarding API on the forum. As for sending events, appropriate API call will be available in 1.1.8.

Quote from: danieln on January 01, 2012, 05:12:18 PM
2. Another requirement is to be able to execute commands from the network map on hosts and components. Is it possible to define such commands to be invoked from a context menu on the map? (e.g. open a web browser with a specific URL)

Yes, it's possible. You can define various "object tools", including for open specific URL or executing command either on management server, administrator's machine, or remote node with NetXMS agent. Those tools accessible anywhere in console where you see objects - on network maps, in object browser, in alarm list, etc.

Best regards,
Victor
#5629
General Support / Re: AIX Installation
December 30, 2011, 12:40:05 PM
Hi!

What database you plan to use?

Best regards,
Victor
#5630
Hi!

What is exact purpose of monitoring this web site? If you need to detect content changes on any time except allowed, you can just use "diff" threshold, and in event processing policy skip event generated by threshold if it occurs within valid content change time interval.

Best regards,
Victor
#5631
General Support / Re: HP EVA integration
December 30, 2011, 12:35:05 PM
Hi!

If you run script from command line, you should get output similar to this:

root@netxms:~# /opt/netxms/bin/hp_eva_collect_data.pl
EVA.Disk[7].loops.loop[2].loopname=loopb
EVA.DiskShelf[1].diskslot[2].name=diskslot2
EVA.Disk[7].objecttype=disk
EVA.DiskShelf[1].diskslot[6].diskid=080720072004000CCA65B9400000000000000000
EVA.Controller[1].datablocksize=512
EVA.Disk[3].rssindex=6
EVA.Controller[1].controllername=Controller 1
EVA.Disk[1].disktype=fibre_channel_disk
EVA.DiskShelf[1].diskslot[11].name=diskslot11
EVA.DiskShelf[1].cooling.fan[2].firmware=80.1
EVA.DiskShelf[1].diskslot[5].diskwwn=2004-000c-ca2a-f588-0000-0000-0000-0000
EVA.Disk[8].operationalstate=attention
EVA.Disk[7].diskgroupname=Default Disk Group
EVA.Disk[3].operationalstatedetail=member_attention

... and so on. Do you get it?

Best regards,
Victor

#5632
Hi!

Alarm generation and actions are different things. For generating alarm you do not need an action - it's just special attributes in event processing policy rule. To set rule to generate alarm, do the following (assuming you already have rule object called "rule" of type EventProcessingPolicyRule):


rule.setFlags(rule.getFlags() | EventProcessingPolicyRule.GENERATE_ALARM);
rule.setAlarmMessage("%m");  // it's an example, you can specify your real alarm message here
rule.setAlarmSeverity(0);   // specify your severity
rule.setAlarmKey("");   // specify alarm key


and to set rule to terminate alarm:


rule.setFlags(rule.getFlags() | EventProcessingPolicyRule.GENERATE_ALARM);
rule.setAlarmSeverity(Severity.UNMANAGED);   // Severity UNMANAGED indicates alarm termination rule
rule.setAlarmKey("");   // specify alarm key


Also, you can take a look at property pages in nxmc-epp plugin in management console.

Best regards,
Victor
#5633
General Support / Re: Alarms
December 27, 2011, 11:53:02 AM
No, it is not necessary. Empty main() will be created by script compiler if it was not defined explicitly.

Best regards,
Victor
#5634
Feature Requests / Re: Java Console - Script Library
December 27, 2011, 11:22:04 AM
Just added "rename script" function to the Java console.

Quote from: lindeamon on December 25, 2011, 01:37:19 PM
when will the java console include all the old features of the native console ?

I hope that version 1.1.8 will be able to replace legacy console completely. There are no much functions left.

Best regards,
Victor
#5635
General Support / Re: Alarms
December 27, 2011, 11:17:42 AM
Hi!

There are some confusion caused primarily by giving script itself and a function inside this script the same name. In "use" operator you should use script name (you can think of it as of virtual file name) - the one you see in script list in the library. Then, you can call functions from that script using their respective names - name of the function may or may not be identical to script name. Note that each script has it's own main() function, even if you do not declare it explicitly, so you cannot call main() function of another script. One script may provide multiple functions, like in this example:

Script in the library called "MyScript":


/* function 1 */
sub f1(p)
{
   println "f1 called with parameter " . p;
}


/* function 2 */
sub f2(p)
{
   println "f2 called with parameter " . p;
}


and then you use it in some other script:


use MyScript;  /* load script from library by it's name */

f1(1);  /* call function f1 */

f2(2); /* call function f2 */


Script above will produce output


f1 called with parameter 1
f2 called with parameter 2


Best regards,
Victor
#5636
Hi!

Quote from: dogz on December 27, 2011, 06:26:03 AM
I would like to know the problem is due to the web service stop or the web service is started but can't response (maybe Apache daemon is dead) or due to the programming failure or the web page is changed by crackers and so on.

You should monitor multiple things and react to them differently. First, you should monitor state of Apache service via System.ServiceState parameter.  If it is not running, you can automatically restart it using actions. Also, you probably should monitor that your web server responds correctly to HTTP requests. You can done it by creating network service under web server node, or by using ServiceCheck.HTTP agent's parameter. Search the forum, there should be instructions about network service configuration. Also, if you have static web pages, you might want to monitor that they are not changed by using ESC subagent - it provides checksum calculation for web pages.

Best regards,
Victor
#5637
General Support / Re: Alarms
December 25, 2011, 05:33:35 PM
You should not have function main() in library script. Try to change it like this:


sub CISCO_Config_Event_Config(e)
{
    switch(e)
    {
    case 3: return "running";
    case 4: return "startup";
    }
}


It is strange that server crashes. I'll try to reproduce it myself.

Best regards,
Victor
#5638
General Support / Re: Alarms
December 25, 2011, 01:42:24 PM
Parameters can be passed to subroutines like that:


sub main()
{
   f(1, 2);
   f(3, 4);
}

sub f(p1, p2)
{
   println "parameter 1 is " . p1;
   println "parameter 2 is " . p2;
}


If you have multiple parameters which needs to be converted using same function, you can create separate script in the library containing this function, and call it from different small scripts. For example, create script called "convert" with function "convert":


convert(p)
{
   // do conversion here
   return converted_value;
}


then create scripts like that for each parameter:

convert_p1:


use convert;
return convert($event->parameters[1]);


convert_p2:


use convert;
return convert($event->parameters[2]);


and so on.

Best regards,
Victor
#5639
General Support / Re: Alarms
December 25, 2011, 01:25:17 PM
Hi!

Currently it is not possible - server always calls main() subroutine when expanding %[] macro. I can add an option to specify parameters and/or entry points to these scripts - in 1.1.8 or 1.1.9, depending on how fast I will fix other things from to-do list.

Best regards,
Victor
#5640
General Support / Re: cannot install netxms webserver
December 25, 2011, 01:19:51 PM
Sorry, I forgot to mention it - in 1.1.x correct configure option is --with-webui instead of --with-nxhttpd.

Best regards,
Victor