|
From: John S. <jo...@uk...> - 2001-06-21 22:13:46
|
Yup, I was thinking that.
ATM the way the config file works you could say something in My_Config.cf
like:
OS # uncomment yours
NAME = Linux
# NAME = Solaris
# NAME = FreeBSD
... etc ...
and include the actual code in the config file:
PING
Solaris {my $ip=shift; `/usr/sbin/ping $ip 1`=~/alive/;}
Linux {my $ip=shift; `/bin/ping -c $ip`=~/(\d) packets received/ or
die; return $1}
(NB that should be tabs not spaces after Solaris and Linux above)
and in the code say
sub ping
{
my $IPadd = shift;
return &{$CONFIG{PING}{ $CONFIG{OS}{NAME} }}($IPadd) ;
}
I haven't tried that and it's late, so that may be horribly wrong ;-)
--
John Stumbles jo...@uk... http://www.stumbles.org/John
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
----- Original Message -----
From: Asher Yanich <aya...@cs...>
To: myNMS mailing list <MyN...@li...>
Sent: Thursday, June 21, 2001 8:20 PM
Subject: [MyNMS-users] resolving some portability issues.
>
> I suggest we either have a config option ARCH for architecture, or we
> decide for ourselves:
>
> $arch = `uname -r`;
>
> Than we have our condition for ping, and groking the process state on
> other architectures.
>
> ~asher
>
>
> _______________________________________________
> MyNMS-users mailing list
> MyN...@li...
> http://lists.sourceforge.net/lists/listinfo/mynms-users
>
|