Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
52f174fa
Commit
52f174fa
authored
Sep 13, 2006
by
Leigh B. Stoller
Browse files
Some cleanup to my silly little event viewer widget, and stick it on
the Show Experiment menu to see if anyone uses it.
parent
bfae3cdb
Changes
2
Hide whitespace changes
Inline
Side-by-side
utils/spewevents.in
View file @
52f174fa
...
...
@@ -125,10 +125,18 @@ if ($fromweb) {
#
# Loop.
#
my
$lastevent_time
=
time
();
while
(
1
)
{
# Quit when the experiment is no longer active.
last
if
(
ExpState
(
$pid
,
$eid
)
ne
EXPTSTATE_ACTIVE
());
# Quit if no events for a long time.
if
(
time
()
-
$lastevent_time
>
300
)
{
syswrite
(
STDOUT
,
"
No events for a long time; stopping ...
\n
");
last
;
}
event_poll_blocking
(
$handle
,
2000
);
}
...
...
@@ -147,16 +155,26 @@ sub callbackFunc($$$) {
my
$eventtype
=
event_notification_get_eventtype
(
$handle
,
$notification
);
my
$arguments
=
event_notification_get_arguments
(
$handle
,
$notification
);
my
$string
=
"
$time
$group
$host
$objtype
$objname
$eventtype
";
$string
.=
"
ARGS:
$arguments
"
if
(
defined
(
$arguments
));
$string
.=
"
\n
";
my
$string
=
sprintf
("
%-12s %-10s %-15s %-12s %-15s %-15s
",
"
$time
",
"
$group
",
"
$host
",
"
$objtype
",
"
$objname
",
"
$eventtype
");
if
(
defined
(
$arguments
))
{
# Trim extra whitespace.
$arguments
=~
s/^\s+//
;
$arguments
=~
s/\s+$//
;
$string
.=
"
$arguments
";
$string
.=
"
\n
";
}
my
$rval
=
syswrite
(
STDOUT
,
$string
);
# If the web page stops ...
# If the web page stops this is only way to catch it and exit.
# Hence, the use of syswrite so we can get status back.
exit
(
0
)
if
(
!
defined
(
$rval
));
$lastevent_time
=
time
();
}
www/showexp.php3
View file @
52f174fa
...
...
@@ -397,6 +397,9 @@ if ($expstate == $TB_EXPTSTATE_ACTIVE) {
WRITESUBMENUBUTTON
(
"Link Tracing/Monitoring"
,
"linkmon_list.php3?pid=
$exp_pid
&eid=
$exp_eid
"
);
WRITESUBMENUBUTTON
(
"Event Viewer"
,
"showevents.php?pid=
$exp_pid
&eid=
$exp_eid
"
);
#
# Admin and project/experiment leaders get this option.
#
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment