Commit 7a48c7b7 authored by Dietmar Maurer's avatar Dietmar Maurer

add ceph log view

parent 7932cae3
......@@ -266,6 +266,7 @@ __PACKAGE__->register_method ({
{ name => 'status' },
{ name => 'crush' },
{ name => 'config' },
{ name => 'log' },
];
return $result;
......@@ -834,4 +835,61 @@ __PACKAGE__->register_method ({
return $txt;
}});
__PACKAGE__->register_method({
name => 'log',
path => 'log',
method => 'GET',
description => "Read ceph 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 $logfile = "/var/log/ceph/ceph.log";
my ($count, $lines) = PVE::Tools::dump_logfile($logfile, $param->{start}, $param->{limit});
$rpcenv->set_result_attrib('total', $count);
return $lines;
}});
......@@ -463,6 +463,12 @@ Ext.define('PVE.node.Ceph', {
title: 'Crush',
xtype: 'pveNodeCephCrushMap',
itemId: 'crushmap'
},
{
title: 'Log',
itemId: 'log',
xtype: 'pveLogView',
url: "/api2/extjs/nodes/" + nodename + "/ceph/log"
}
],
listeners: {
......
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