--- You wrote:
Does anyone have a sample of a Perl script feeding into a command-line
probe in 4.1.2 or later?
Having trouble getting several Perl scripts converted across to report
to InterMapper as command-line probes - everything is fine while the
scripts are successful, but none of the other states
(warning/alarm/down) come through correctly.
--- end of quote ---
Here's an example perl script and probe file. They don't do anything interesting, but
they show how to return the states. Let me know if you still have questions.
-- Christopher
The perl script, named sample.pl for our purposes:
#!/usr/bin/perl
my $addr = shift;
my $result = int(rand(4));
print "Pretending we got result of $result from $addr.\n";
exit $result;
Note that we assume that sample.pl has been chmod'd +x and is in the Tools folder in
InterMapper Settings.
The probe file:
<!--
Comand Line Perl Sample (com.dartware.perl.sample)
Copyright (c) 2003 Dartware, LLC. All rights reserved.
-->
<header>
type="cmd-line"
package="com.dartware"
probe_name="perl.sample"
human_name="Perl Sample"
version="1.1"
address_type="IP"
</header>
<description>
\GB\Perl Sample\p\
A sample command line probe which executes a perl script.
</description>
<parameters>
</parameters>
<command-line>
-- Empty path forces the InterMapper Settings:Tools directory
path=""
cmd="sample.pl ${ADDRESS}"
</command-line>
<command-data>
-- Currently unused.
</command-data>
<command-exit>
down:${EXIT_CODE}=3
alarm:${EXIT_CODE}=2
warning:${EXIT_CODE}=1
okay:${EXIT_CODE}=0
</command-exit>
<output>
</output>
____________________________________________________________________
List archives: http://www.mail-archive.com/intermapper-talk%40list.dartware.com/
To unsubscribe: send email to: [EMAIL PROTECTED]