Re: nagios - "Invalid warning threshold: -s"...

2007-09-08 Thread Mako Gabor

Wagner Ferenc irta:
> A kolléga azóta felépült.  Ha be van kapcsolva az embedded
> Perl, akkor is könnyen rávehető a Nagios, hogy külső perlt
> használjon: expliciten oda kell írni a parancssor elejére,
> például:
>
> command_line perl /amihez/nem/akarsz.pl ePN-t hasznalni
>
> Ja, és a pontosvesszőkkel vigyázz, nem dokumentált, de ott
>  a sor vége...
>

A perl-lel nem igen foglalkoztam. Hogyan is gondoltad ezt?


Igy kezdodik a check_disk_smb perl script es a vegen  sor, ahol 
hibat jelez:
#! /usr/bin/perl -w
#
# check_disk.pl [warn] [critical]
# [port]
#
# Nagios host script to get the disk usage from a SMB share
#
#

require 5.004;
use POSIX;
use strict;
use Getopt::Long;
use vars qw($opt_P $opt_V $opt_h $opt_H $opt_s $opt_W $opt_u
$opt_p $opt_w $opt_c $verbose);
use vars qw($PROGNAME);
use lib "/usr/lib/nagios/plugins" ;
use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);

sub print_help ();
sub print_usage ();

$PROGNAME = "check_disk_smb";

$ENV{'PATH'}='';
$ENV{'BASH_ENV'}='';
$ENV{'ENV'}='';

Getopt::Long::Configure('bundling');
GetOptions
("v"   => \$verbose, "verbose"=> \$verbose,
 "P=s" => \$opt_P, "port=s" => \$opt_P,
 "V"   => \$opt_V, "version"=> \$opt_V,
 "h"   => \$opt_h, "help"   => \$opt_h,
 "w=s" => \$opt_w, "warning=s"  => \$opt_w,
 "c=s" => \$opt_c, "critical=s" => \$opt_c,
 "p=s" => \$opt_p, "password=s" => \$opt_p,
 "u=s" => \$opt_u, "username=s" => \$opt_u,
 "s=s" => \$opt_s, "share=s"=> \$opt_s,
 "W=s" => \$opt_W, "workgroup=s" => \$opt_W,
 "H=s" => \$opt_H, "hostname=s" => \$opt_H);

if ($opt_V) {
print_revision($PROGNAME,'$Revision: 1.13 $'); #'
exit $ERRORS{'OK'};
}

if ($opt_h) {print_help(); exit $ERRORS{'OK'};}

my $smbclient= "$utils::PATH_TO_SMBCLIENT " ;
my $smbclientoptions= $opt_P ? "-p $opt_P " : "";


# Options checking

($opt_H) || ($opt_H = shift) || usage("Host name not specified\n");
my $host = $1 if ($opt_H =~ /^([-_.A-Za-z0-9]+\$?)$/);
($host) || usage("Invalid host: $opt_H\n");

($opt_s) || ($opt_s = shift) || usage("Share volume not 
specified\n");
my $share = $1 if ($opt_s =~ /^([-_.A-Za-z0-9]+\$?)$/);
($share) || usage("Invalid share: $opt_s\n");

($opt_u) || ($opt_u = shift) || ($opt_u = "guest");
my $user = $1 if ($opt_u =~ /^([-_.A-Za-z0-9\\]+)$/);
($user) || usage("Invalid user: $opt_u\n");

($opt_p) || ($opt_p = shift) || ($opt_p = "");
my $pass = $1 if ($opt_p =~ /(.*)/);

($opt_w) || ($opt_w = shift) || ($opt_w = 85);
my $warn = $1 if ($opt_w =~ /^([0-9]{1,2}\%?|100\%?|[0-9]+[kMG])$/);
($warn) || usage("Invalid warning threshold: $opt_w\n");
 ^- ez a hibauzenet!!!
// ..stb.



Gabor

_
linux lista  -  linux@mlf.linux.rulez.org
http://mlf2.linux.rulez.org/mailman/listinfo/linux


Huawei E220

2007-09-08 Thread BEREGNYEI Balazs
Hali,

Nem sikerul betarcsaznom a vodafone-hoz a fenti USB-s HSDPA modemmel. 
Probaltam a generic usbserial drivert es az option drivert is. A 
/dev/ttyUSB0 mukodik is, modem valaszol, de a wvdial a ppp kornyeken 
leall. A kernelem 2.6.21-es, Debian etch. Lasd /var/log/messages, wvdial 
kimenete, /etc/wvdial.conf tartalma. Mi lehet a hiba?

Koszi,
BB

Sep  8 14:01:25 c64 pppd[2584]: pppd 2.4.4 started by root, uid 0
Sep  8 14:01:25 c64 pppd[2584]: Using interface ppp0
Sep  8 14:01:25 c64 pppd[2584]: Connect: ppp0 <--> /dev/ttyUSB0
Sep  8 14:01:25 c64 pppd[2584]: CHAP authentication succeeded
Sep  8 14:01:25 c64 pppd[2584]: CHAP authentication succeeded
Sep  8 14:01:27 c64 pppd[2584]: Modem hangup
Sep  8 14:01:27 c64 pppd[2584]: Connection terminated.
Sep  8 14:01:27 c64 pppd[2584]: Exit.

# wvdial
--> WvDial: Internet dialer version 1.56
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2
ATQ0 V1 E1 S0=0 &C1 &D2
OK
--> Modem initialized.
--> Idle Seconds = 300, disabling automatic reconnect.
--> Sending: ATDT*99***1#
--> Waiting for carrier.
ATDT*99***1#
CONNECT
--> Carrier detected.  Starting PPP immediately.
--> Starting pppd at Sat Sep  8 14:01:25 2007
--> Pid of pppd: 2584
--> Using interface ppp0
--> Disconnecting at Sat Sep  8 14:01:27 2007
--> The PPP daemon has died: A modem hung up the phone (exit code = 16)
--> man pppd explains pppd error codes in more detail.
--> Try again and look into /var/log/messages and the wvdial and pppd man 
pages for more information.

A wvdial.conf tartalma:

[Dialer Default]
Modem = /dev/ttyUSB0
Baud = 921600
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2
Area Code =
Phone = *99***1#
Username =vodafone
Password =
Ask Password = 0
Dial Command = ATDT
Stupid Mode = 1
Compuserve = 0
Force Address =
Idle Seconds = 300
DialMessage1 =
DialMessage2 =
ISDN = 0
Auto DNS = 1

_
linux lista  -  linux@mlf.linux.rulez.org
http://mlf2.linux.rulez.org/mailman/listinfo/linux


Re: nagios - "Invalid warning threshold: -s"...

2007-09-08 Thread Gabor HALASZ
Mako Gabor írta:
>"w=s" => \$opt_w, "warning=s"  => \$opt_w,
> ($opt_w) || ($opt_w = shift) || ($opt_w = 85);
> my $warn = $1 if ($opt_w =~ /^([0-9]{1,2}\%?|100\%?|[0-9]+[kMG])$/);
> ($warn) || usage("Invalid warning threshold: $opt_w\n");
>  ^- ez a hibauzenet!!!
> // ..stb.
>   
A w vagy warnings parameter nem illeszkedik a fenti regexpre.

_
linux lista  -  linux@mlf.linux.rulez.org
http://mlf2.linux.rulez.org/mailman/listinfo/linux


Re: Huawei E220

2007-09-08 Thread Zs
Hi!

> Sep  8 14:01:25 c64 pppd[2584]: CHAP authentication succeeded
> Sep  8 14:01:25 c64 pppd[2584]: CHAP authentication succeeded
> Sep  8 14:01:27 c64 pppd[2584]: Modem hangup
Eltelt 2 sec, ami alatt ugyan valami történt, de nem tudjuk mi.
Esetleg egy debug paraméter a pppd-nek? Hátha informatívabbá
válik a log, miért is van modem hangup?

Zsolt
_
linux lista  -  linux@mlf.linux.rulez.org
http://mlf2.linux.rulez.org/mailman/listinfo/linux


Re: Huawei E220

2007-09-08 Thread Zidarics Zoltan
hello,

En pont ugyanevvel ahibaval kuzdok a Pannon-nal. Szerencsere nekem van egy 
sajat e220-asom, ami tokeletesen mukodik. Amivel baj van, az egy ceges darab. 
Ebbol azt a koveteztetest vontam le, hogy a szolgaltatonal van a hiba. 
Sajnos, mivel ceges, velem nem all szoba a Pannon, csak a ceg kozvetitesevel 
tudok kutakodni a Pannonnal. Eleg lessan megy :(

2007. szeptember 8. 14.04 dátummal BEREGNYEI Balazs ezt írta:
>
> # wvdial
> --> WvDial: Internet dialer version 1.56
> --> Cannot get information for serial port.
> --> Initializing modem.
> --> Sending: ATZ
> ATZ
> OK
> --> Sending: ATQ0 V1 E1 S0=0 &C1 &D2
> ATQ0 V1 E1 S0=0 &C1 &D2
> OK
> --> Modem initialized.
> --> Idle Seconds = 300, disabling automatic reconnect.
> --> Sending: ATDT*99***1#
> --> Waiting for carrier.
> ATDT*99***1#
> CONNECT
> --> Carrier detected.  Starting PPP immediately.
> --> Starting pppd at Sat Sep  8 14:01:25 2007
> --> Pid of pppd: 2584
> --> Using interface ppp0
> --> Disconnecting at Sat Sep  8 14:01:27 2007
> --> The PPP daemon has died: A modem hung up the phone (exit code = 16)
> --> man pppd explains pppd error codes in more detail.
> --> Try again and look into /var/log/messages and the wvdial and pppd man
> pages for more information.
>
udv,
-- 
Zoltan Zidarics programmer
PTE University Pecs, Hungary
icq: 43288694
_
linux lista  -  linux@mlf.linux.rulez.org
http://mlf2.linux.rulez.org/mailman/listinfo/linux


xsltproc ervenytelen xhtml-t general

2007-09-08 Thread lirul
Hello!

Ha az XSL fajlom elejen igy definialom az outputot:

http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>

akkor a generalt html valoban html lesz, nem xhtml; azaz megengedettek
a lezaratlan tag-ek. (pl. meta, br, hr) Csak tudnam akkor minek adom meg
a doctype-ot?!

Ha a fenti helyett ezt irom:

http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>

akkor nem lesznek lezaratlan tag-ek (xml ugye nem engedi), am szamomra
rejtelyes modon nehany div kap egy xmlns="" attributumot. Nem mind,
de nem talaltam me'g meg a kivalasztas hogyanjat.

S mindez miert is baj? Mert a W3C szabvany szerint a div-nek nincs ilyen
attributuma, ezert kapasbol invalid az oldal. (Ne kezdjunk flamebe, hogy
'huuu validsagfetista'. :))

http://www.w3.org/TR/html4/struct/global.html#h-7.5.4

$ xsltproc --version
Using libxml 20628, libxslt 10120 and libexslt 813
xsltproc was compiled against libxml 20627, libxslt 10120 and libexslt 813
libxslt 10120 was compiled against libxml 20627
libexslt 813 was compiled against libxml 20627

A temaban mar kicsit szetneztem, latni, hogy mas is belefutott mar ebbe,
de *valoban mukodo* megoldast sehol nem talaltam. Par URL:

http://www.perlmonks.org/?node_id=475895
http://mail.gnome.org/archives/xslt/2005-November/msg5.html
(probaltam)
http://mail.gnome.org/archives/xml/2003-December/msg00201.html

Workaroundkent mar csak azt tudom elkepzelni, hogy a legeneralt oldalon
utolag vegig kell futtatni valamilyen postprocess scriptet, ami kiirtja
az xhtml-ben nem megengedett dolgokat, de hat ez milyen mar?!

Koszi!
-- 
  LiRulhttp://www.hixsplit.hu/
  Un*x + HIX = hixsplit   Lehet, de nem erdemes nelkule...
_
linux lista  -  linux@mlf.linux.rulez.org
http://mlf2.linux.rulez.org/mailman/listinfo/linux