Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 90779 Details for
Bug 139008
net-analyzer/nagios-grapher-1.6_rc1-r1 - Daemon and CGIs for getting quite pretty charts out of nagios
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Required Bugfix
collect2.pl.patch (text/plain), 2.28 KB, created by
Christopher Vahldieck
on 2006-07-03 08:30:30 UTC
(
hide
)
Description:
Required Bugfix
Filename:
MIME Type:
Creator:
Christopher Vahldieck
Created:
2006-07-03 08:30:30 UTC
Size:
2.28 KB
patch
obsolete
>--- nagios-grapher-1.6/collect2.pl 2006-06-07 18:18:55.000000000 +0200 >+++ nagios-grapher-1.6_rc1-r1/collect2.pl 2006-07-03 14:48:28.000000000 +0200 >@@ -207,6 +207,9 @@ > > # Getting XML Data > $xml_hash = $ng->get_ngrapherxml(); >+ >+# No buffered streams >+$| = 1; > > if ($interface =~ /network/i && defined($net_port)) { > # Creating a UDP socket >@@ -215,20 +218,9 @@ > LocalPort => $net_port, > Proto => 'udp' > ) || die "Creating socket faild: $@"; >-} >-else { >- # Setting Up Named Pipe >- $ng->print_log ("PRG: using FIFO") if ($opt_verbose & $LOG_PRG_STATUS); >- create_pipe(); >-} >- >-# LOOP MAIN >-while (1) { >- # No buffered streams >- $| = 1; > >- # Reading from FIFO or from UDP socket. >- if ($interface =~ /network/i && defined($net_port) && defined($socket)) { >+ # LOOP MAIN for network >+ while (1) { > # Read from UDP socket > $fifo_string = ''; > >@@ -241,17 +233,34 @@ > $fifo_string =~ s/\\t/\t/g; > $fifo_string =~ s/\\n/\n/g; > >- $socket->send("NagiosGrapher: thanks $s_ipaddr:$s_port.") >+ $socket->send("NagiosGrapher: thanks $s_ipaddr:$s_port."); >+ process_data($fifo_string); > } >- else { >- # Open the PIPE and read >- open( FIFO, $pipe ) >- || die "Can't open pipe ($pipe)"; >- $fifo_string = <FIFO>; >- close(FIFO); >+} >+else { >+ # Setting Up Named Pipe >+ $ng->print_log ("PRG: using FIFO") if ($opt_verbose & $LOG_PRG_STATUS); >+ create_pipe(); >+ # Open the pipe (and cause loosing data sucks we will never ever close it) >+ open( FIFO, "<$pipe" ) || die "Can't open pipe '$pipe'"; >+ >+ # LOOP MAIN for fifo >+ while (1) { >+ # Get the news out of the pipe and process them >+ process_data($_) while (<FIFO>); >+ # In case there is nothing left, reopen the pipe to make this process sleep while waiting for new data >+ open( FIFO, "<$pipe" ) || die "Failed to reopen the pipe: '$pipe'"; > } >+} >+# There is no way out (except dying) > >+ >+# Subs: >+sub process_data { >+ $fifo_string = shift; > chomp($fifo_string); >+ return if ( $fifo_string eq "" ); >+ > $ng->print_log ("PIPE: $fifo_string") if ( defined($fifo_string) && ($opt_verbose & $LOG_PIPE)); > > # Splitting pipe values >@@ -568,12 +577,7 @@ > # Clearing another values... > %values = (); > } >-# End LOOP MAIN > >-# Default exit >-exit(0); >- >-# Subs: > # Helpscreen > sub print_help { > print "$progname: Helpscreen\n";
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 139008
:
90777
|
90778
|
90779
|
90780
|
90781
|
90782
|
90783
|
102450
|
115837
|
115838
|
115843