Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-stable
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
emulab
emulab-stable
Commits
bc2b571d
Commit
bc2b571d
authored
Aug 31, 2005
by
Leigh B. Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Just for Mike ... add a console log icon and add option to show last N
lines of console log.
parent
1174c5e7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
6 deletions
+47
-6
utils/spewconlog.in
utils/spewconlog.in
+25
-4
www/showconlog.php3
www/showconlog.php3
+14
-1
www/showstuff.php3
www/showstuff.php3
+8
-1
No files found.
utils/spewconlog.in
View file @
bc2b571d
...
...
@@ -12,12 +12,14 @@ use Getopt::Std;
#
sub
usage
()
{
print
(
STDOUT
"
Usage: spewconlog node
\n
");
print
(
STDOUT
"
Usage: spewconlog
[-l linecount]
node
\n
");
exit
(
-
1
);
}
my
$optlist
=
"";
my
$logdir
=
"
/var/log/tiplogs
";
my
$optlist
=
"
l:
";
my
$linecount
=
0
;
my
$logdir
=
"
/var/log/tiplogs
";
my
$logname
;
my
$cmd
;
#
# Configure variables
...
...
@@ -74,6 +76,18 @@ my $logfile;
if
(
!
getopts
(
$optlist
,
\
%options
))
{
usage
();
}
if
(
defined
(
$options
{"
l
"}))
{
$linecount
=
$options
{"
l
"};
# Untaint of course.
if
(
$linecount
=~
/^([\d]+)$/
)
{
$linecount
=
$
1
;
}
else
{
die
("
*** $0:
\n
"
.
"
Bad data in linecount:
$linecount
\n
");
}
}
usage
()
if
(
@ARGV
!=
1
);
my
$node
=
$ARGV
[
0
];
...
...
@@ -117,6 +131,13 @@ else {
$logname
=
"
$logdir
/
${node}
.log
"
}
if
(
$linecount
)
{
$cmd
=
"
tail -
"
.
$linecount
}
else
{
$cmd
=
"
cat
";
}
#
# Run an ssh command in a child process, protected by an alarm to
# ensure that the ssh is not hung up forever if the machine is in
...
...
@@ -144,6 +165,6 @@ if ($syspid) {
# Now we want to ssh over and cat the file.
#
$UID
=
0
;
system
("
sshtb -host
$tipserver
cat
$logname
");
system
("
sshtb -host
$tipserver
$cmd
$logname
");
$UID
=
$SAVEUID
;
exit
((
$?
==
0
?
0
:
1
));
www/showconlog.php3
View file @
bc2b571d
...
...
@@ -40,6 +40,19 @@ else {
PAGEARGERROR
(
"Must specify a node ID!"
);
}
#
# Look for linecount argument
#
if
(
isset
(
$linecount
)
&&
$linecount
!=
""
)
{
if
(
!
TBvalid_integer
(
$linecount
))
{
PAGEARGERROR
(
"Illegal characters in linecount!"
);
}
$optarg
=
"-l
$linecount
"
;
}
else
{
$optarg
=
""
;
}
#
# A cleanup function to keep the child from becoming a zombie.
#
...
...
@@ -56,7 +69,7 @@ function SPEWCLEANUP()
}
register_shutdown_function
(
"SPEWCLEANUP"
);
$fp
=
popen
(
"
$TBSUEXEC_PATH
$uid
nobody webspewconlog
$node_id
"
,
"r"
);
$fp
=
popen
(
"
$TBSUEXEC_PATH
$uid
nobody webspewconlog
$
optarg
$
node_id
"
,
"r"
);
if
(
!
$fp
)
{
USERERROR
(
"Spew console log failed!"
,
1
);
}
...
...
www/showstuff.php3
View file @
bc2b571d
...
...
@@ -1203,7 +1203,8 @@ function SHOWNODES($pid, $eid, $sortby) {
<th>Last Log Message</th>
\n
"
;
}
echo
" <th><a href=
\"
docwrapper.php3?docname=ssh-mime.html
\"
>SSH</a></th>
<th><a href=
\"
faq.php3#tiptunnel
\"
>Console</a></th>"
;
<th><a href=
\"
faq.php3#tiptunnel
\"
>Console</a></th> .
<th>Log</th>"
;
# Only put out a RDP column header if there are any Windows nodes.
$windows_query_result
=
DBQueryFatal
(
"SELECT r.pid,r.eid,n.node_id,oi.OS "
.
...
...
@@ -1294,6 +1295,12 @@ function SHOWNODES($pid, $eid, $sortby) {
<A href='nodetipacl.php3?node_id=
$node_id
'>
<img src=
\"
console.gif
\"
alt=c></A>
</td>
\n
"
;
echo
" <td align=center>
<A href='showconlog.php3?node_id=
$node_id
"
.
"&linecount=200'>
<img src=
\"
/icons/f.gif
\"
alt='console log'></A>
</td>
\n
"
;
}
if
(
$iswindowsnode
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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