Commit f3feadbb authored by Dietmar Maurer's avatar Dietmar Maurer

add bootlog

we use boodlogd on wheezy
parent 884ac1ab
...@@ -104,6 +104,7 @@ __PACKAGE__->register_method ({ ...@@ -104,6 +104,7 @@ __PACKAGE__->register_method ({
my $result = [ my $result = [
{ name => 'version' }, { name => 'version' },
{ name => 'syslog' }, { name => 'syslog' },
{ name => 'bootlog' },
{ name => 'status' }, { name => 'status' },
{ name => 'subscription' }, { name => 'subscription' },
{ name => 'tasks' }, { name => 'tasks' },
...@@ -448,6 +449,62 @@ __PACKAGE__->register_method({ ...@@ -448,6 +449,62 @@ __PACKAGE__->register_method({
return $lines; return $lines;
}}); }});
__PACKAGE__->register_method({
name => 'bootlog',
path => 'bootlog',
method => 'GET',
description => "Read boot log",
proxyto => 'node',
permissions => {
check => ['perm', '/nodes/{node}', [ 'Sys.Syslog' ]],
},
protected => 1,
parameters => {
additionalProperties => 0,
properties => {
node => get_standard_option('pve-node'),
start => {
type => 'integer',
minimum => 0,
optional => 1,
},
limit => {
type => 'integer',
minimum => 0,
optional => 1,
},
},
},
returns => {
type => 'array',
items => {
type => "object",
properties => {
n => {
description=> "Line number",
type=> 'integer',
},
t => {
description=> "Line text",
type => 'string',
}
}
}
},
code => sub {
my ($param) = @_;
my $rpcenv = PVE::RPCEnvironment::get();
my $user = $rpcenv->get_user();
my $node = $param->{node};
my ($count, $lines) = PVE::Tools::dump_logfile("/var/log/boot", $param->{start}, $param->{limit});
$rpcenv->set_result_attrib('total', $count);
return $lines;
}});
my $sslcert; my $sslcert;
__PACKAGE__->register_method ({ __PACKAGE__->register_method ({
......
...@@ -109,6 +109,14 @@ Ext.define('PVE.node.Config', { ...@@ -109,6 +109,14 @@ Ext.define('PVE.node.Config', {
url: "/api2/extjs/nodes/" + nodename + "/syslog" url: "/api2/extjs/nodes/" + nodename + "/syslog"
} }
]); ]);
me.items.push([
{
title: 'Bootlog',
itemId: 'bootlog',
xtype: 'pveLogView',
url: "/api2/extjs/nodes/" + nodename + "/bootlog"
}
]);
} }
me.items.push([ me.items.push([
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment