[Date Prev]   [Date Next] [Thread Prev]   [Thread Next] [Date Index]   [Thread Index]

 

     [snips-users] x outside of string at /usr/local/etc/nocol/bin/nocollib.pl line 209.

  • To: nocol-users at navya com
  • Subject: [snips-users] x outside of string at /usr/local/etc/nocol/bin/nocollib.pl line 209.
  • From: Tuc <tuc at ttsg com>
  • Date: Mon, 28 Oct 2002 20:05:00 -0500 (EST)
Hi,

	Trying to write my own program to send its logging to nocol.

	RANDOMLY its exiting with :

x outside of string at /usr/local/etc/nocol/bin/nocollib.pl line 209.


	When I write the event, I'm doing :

sub slogevent {

    my ($pdatafile,$pmachine,$psiteip,$psender,$pdbfile,$plevel)= at _;

    open(OEVENTS, ">> $pdatafile") || die("Error opening file : $pdatafile\n");
    &init_event($pmachine,$psiteip,$psender);
    $varname{$psender}=$pdbfile;
    $severity{$psender}=$loglevel{$psender}=$plevel;
    $nocop{$psender}=$n_DOWN;
    &writeevent(OEVENTS,$psender);
    &eventlog(&packevent($psender));

} # end of function slogevent()

	passing it :

		name of the datafile (~nocol/data/webmonitor-output")
		machine name (XXXXX.ttsg.com)
		site ip (Put in here a small message)
		sender (webmonitor)
		dbfile (A variable name)
		level (level of the problem)



	Every time the program runs, it basically deletes all the entries
it has for the dbfile :

sub expire_datafile_events {

    local($i) = $sender;
    if (! -e "$datafile") {return;} # if no file then return

    # for reading the NOCOL datafile
    open(IEVENTS, "< $datafile") || die("Error opening file : $datafile");
    # dont overwrite the NOCOL datafile
    open(OEVENTS, "+< $datafile") || die("Error opening file : $datafile");
    seek(OEVENTS, 0, 0) || die("Could not seek\n"); # seek to beginning of file

    # read each event structure from the NOCOL datafile
    while ( &readevent(IEVENTS, $i)) # readevent returns no of bytes read
    {
        local($item) = $varname{$i};

        # if event expired then dont write it back.
        if ($item =~ /^$cdbfile$/) {
            if ($debug > 2) {
                print STDERR "(expire_ev) Expiring Variable: \'$item\'\n";
            }
            next;
        }

        &writeevent(OEVENTS, $i); # write the event back.
    }
    close(IEVENTS); # input stream
    truncate(OEVENTS, tell(OEVENTS)); # truncate file if some events expired
    close(OEVENTS); # output stream

} # end of function expire_datafile_events()


	But for some reason I'm getting the :

x outside of string at /usr/local/etc/nocol/bin/nocollib.pl line 209.


	Any concepts on what my problem (/dev/null personal attacks. ;) )
is?

		Thanks, Tuc/TTSG Internet Services, Inc.

Zyrion Traverse Network Monitoring & Network Management Software