[RFC] initial schema for Logging agent
by apevec@redhat.com
---
src/CMakeLists.txt | 6 ++-
src/log/matahari-log.cpp | 101 ++++++++++++++++++++++++++++++++++++++++++++++
src/schema.xml | 38 +++++++++++++++++
3 files changed, 144 insertions(+), 1 deletions(-)
create mode 100644 src/log/matahari-log.cpp
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9664781..ee8906d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -15,8 +15,9 @@ include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include")
set(M_HOST "matahari-hostd")
set(M_NET "matahari-netd")
set(M_SRV "matahari-serviced")
+set(M_LOG "matahari-logd")
-set(DAEMONS ${M_HOST} ${M_NET} ${M_SRV})
+set(DAEMONS ${M_HOST} ${M_NET} ${M_SRV} ${M_LOG})
file(GLOB SCHEMAS "${CMAKE_CURRENT_SOURCE_DIR}/*.xml")
@@ -29,6 +30,7 @@ add_definitions(-DMATAHARI_BROKER="${MATAHARI_BROKER}")
set(SCHEMA_SOURCES
${CMAKE_CURRENT_BINARY_DIR}/qmf/com/redhat/matahari/Host.cpp
${CMAKE_CURRENT_BINARY_DIR}/qmf/com/redhat/matahari/Network.cpp
+ ${CMAKE_CURRENT_BINARY_DIR}/qmf/com/redhat/matahari/Logging.cpp
${CMAKE_CURRENT_BINARY_DIR}/qmf/com/redhat/matahari/Services.cpp
${CMAKE_CURRENT_BINARY_DIR}/qmf/com/redhat/matahari/Resources.cpp
${CMAKE_CURRENT_BINARY_DIR}/qmf/com/redhat/matahari/EventHeartbeat.cpp
@@ -61,6 +63,8 @@ add_executable(${M_NET} net/matahari-net.cpp ${SCHEMA_SOURCES} ${COMMON_SOURCE
add_executable(${M_SRV} service/matahari-srv.cpp ${SCHEMA_SOURCES} ${COMMON_SOURCES})
target_link_libraries(${M_HOST} msrv)
+add_executable(${M_LOG} log/matahari-log.cpp ${SCHEMA_SOURCES} ${COMMON_SOURCES})
+
foreach(daemon ${DAEMONS})
target_link_libraries(${daemon} mcommon)
if(WIN32)
diff --git a/src/log/matahari-log.cpp b/src/log/matahari-log.cpp
new file mode 100644
index 0000000..6b62ff4
--- /dev/null
+++ b/src/log/matahari-log.cpp
@@ -0,0 +1,101 @@
+/* matahari-log.cpp - Copyright (C) 2010 Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA. A copy of the GNU General Public License is
+ * also available at http://www.gnu.org/copyleft/gpl.html.
+ */
+
+#ifndef WIN32
+#include "config.h"
+#endif
+
+#include <string>
+#include <qpid/management/Manageable.h>
+#include <qpid/agent/ManagementAgent.h>
+#include "matahari/mh_agent.h"
+
+#include "qmf/com/redhat/matahari/Logging.h"
+#include "qmf/com/redhat/matahari/ArgsLoggingExtract_date_range.h"
+#include "qmf/com/redhat/matahari/ArgsLoggingExtract_pattern.h"
+#include "qmf/com/redhat/matahari/ArgsLoggingSystem_logfile.h"
+#include "qmf/com/redhat/matahari/ArgsLoggingTruncate_logfile.h"
+
+extern "C" {
+#include "matahari/logging.h"
+}
+
+class LogAgent : public MatahariAgent
+{
+ private:
+ ManagementAgent* _agent;
+ _qmf::Logging* _management_object;
+
+ public:
+ int setup(ManagementAgent* agent);
+ ManagementObject* GetManagementObject() const { return _management_object; }
+ status_t ManagementMethod(uint32_t method, Args& arguments, string& text);
+};
+
+extern "C" {
+#include <stdlib.h>
+#include <string.h>
+};
+
+int
+main(int argc, char **argv)
+{
+ LogAgent agent;
+ int rc = agent.init(argc, argv);
+ while (rc == 0) {
+ qpid::sys::sleep(1);
+ }
+ return rc;
+}
+
+int
+LogAgent::setup(ManagementAgent* agent)
+{
+ this->_agent = agent;
+ this->_management_object = new _qmf::Logging(agent, this);
+ this->_management_object->set_hostname(get_hostname());
+
+ agent->addObject(this->_management_object);
+
+ return 0;
+}
+
+Manageable::status_t
+LogAgent::ManagementMethod(uint32_t method, Args& arguments, string& text)
+{
+ switch(method)
+ {
+ case _qmf::Logging::METHOD_EXTRACT_DATE_RANGE:
+
+ return Manageable::STATUS_OK;
+
+ case _qmf::Logging::METHOD_EXTRACT_PATTERN:
+
+ return Manageable::STATUS_OK;
+
+ case _qmf::Logging::METHOD_SYSTEM_LOGFILE:
+
+ return Manageable::STATUS_OK;
+
+ case _qmf::Logging::METHOD_TRUNCATE_LOGFILE:
+
+ return Manageable::STATUS_OK;
+
+ }
+ return Manageable::STATUS_NOT_IMPLEMENTED;
+}
diff --git a/src/schema.xml b/src/schema.xml
index ece5d0d..17b4110 100644
--- a/src/schema.xml
+++ b/src/schema.xml
@@ -239,4 +239,42 @@
</method-->
</class>
+ <class name="Logging">
+ <property name="hostname" type="sstr" access="RO" desc="Hostname" index="y"/>
+
+ <method name="extract_date_range">
+ <arg name="filename" dir="I" type="lstr" />
+ <arg name="start" dir="I" type="absTime" />
+ <arg name="end" dir="I" type="absTime" />
+ <arg name="lines" dir="O" type="list" />
+ </method>
+ <method name="extract_pattern">
+ <arg name="filename" dir="I" type="lstr" />
+ <arg name="regex_list" dir="I" type="list" />
+ <arg name="lines" dir="O" type="list" />
+ </method>
+ <!-- What is the point of search_* methods?
+ output is list of tupples:
+ { filename (String), last_modified (Integer) }
+ https://fedorahosted.org/matahari/wiki/LoggingAPIs
+ It's not part of Ricci API which is used as justification
+ http://sources.redhat.com/cluster/conga/ricci_api/logging_api.html
+ method name="search_content">
+ <arg name="paths" dir="I" type="list" />
+ <arg name="regex" dir="I" type="sstr" />
+ <arg name="filenames" dir="O" type="list" />
+ </method>
+ method name="search_name">
+ <arg name="paths" dir="I" type="list" />
+ <arg name="regex_list" dir="I" type="list" />
+ <arg name="filenames" dir="O" type="list" />
+ </method -->
+ <method name="system_logfile">
+ <arg name="filename" dir="O" type="lstr" />
+ </method>
+ <method name="truncate_logfile">
+ <arg name="rc" dir="O" type="uint32" />
+ </method>
+ </class>
+
</schema>
--
1.7.2.3
13 years, 4 months
Updating oVirt Server to the latest Matahari 0.4.0 schema
by apevec@redhat.com
Hi all,
I looked at patching oVirt Server to work with the latest Matahari schema, from Matahari's 'next' branch, version 0.4.0.
ovirt-server depends on matahari version 0.0.5, which is currently latest in Fedora, and it is used during Node registration, to enumerate hardware information.
Usage extracted from src/host-browser/host-register.rb is as follows:
host_list = @qmfc.objects(:package => 'com.redhat.matahari.host', :class => 'Host')
host properties used:
object_id
object_id.agent_key
uuid
hostname
hypervisor
arch
memory
This is all good, those properties do exist in new Matahari 0.4.0 schema, patch for this part would be simply:
--- a/src/host-browser/host-register.rb
+++ b/src/host-browser/host-register.rb
@@ -143,7 +143,7 @@ class HostRegister < Qmf::ConsoleHandler
debugputs "Agent #{agent.key}.connected!"
agent_connected(agent)
- host_list = @qmfc.objects(:package => 'com.redhat.matahari', :class => 'host')
+ host_list = @qmfc.objects(:package => 'com.redhat.matahari.host', :class => 'Host')
puts "host_list length is #{host_list.length}"
host_list.each do |host|
if host.object_id.agent_key == agent.key
Next, old Matahari has 1:N relationship between host and cpu objects, ovirt-server uses it by retrieving a list of cpus for each host:
cpu_info = @qmfc.objects(:package => 'com.redhat.matahari', :class => 'cpu', 'host' => host.object_id)
cpu properties used:
cpunum
corenum
numcores
vendor
model
family
cpuid_lvl
speed
cache
flags[0..251]
New Matahari changed the model, here are CPU-related properties from 0.4.0 Host object, there isn't separate cpu class anymore:
processors uint8 ReadOnly The number of physical CPUs.
cores uint8 ReadOnly The total number of processor cores.
model long-string ReadOnly The processor(s) model description.
"model" is descriptive string, so it's not good enough to replace old CPU details.
On the other hand, oVirt does not really use all those CPU properties, they are just copied into ovirt database.
CPU information could be used to check migration compatibility, but this should be done through libvirt/libvirt-qpid anyway.
So I would propose ovirt-server to just remove cpus table, what does ovirt-devel say?
Last are network interfaces, also 1:N relationship:
nic_info = @qmfc.objects(:package => 'com.redhat.matahari', :class => 'nic', 'host' => host.object_id)
nic properties used:
macaddr
interface
seems to be bug in host-register.rb, it uses "interface_name" property which doesn't exist in matahari 0.0.5 QMF schema!
bandwidth
"nic" class is gone, there's new class 'com.redhat.matahari.net:network' with "hostname" property only and following methods:
'status' Check a network interface
'stop' Stop a network interface
'start' Start a network interface
'destroy' Remove network interface
'list' List IP addresses
'describe' Obtain XML description of a network interface status
Matahari now basically wraps netcf calls in its network agent, so properties like MAC are not directly available, it can be extracted from netcf XML, output of the 'describe' method.
But there's more to it since, netcf can also configure interfaces (not yet in Matahari schema, but it is planned).
Currently, ovirt-server provides network configuration which is downloaded by the Node on boot and applied (via augeas).
Question is should ovirt-server switch fully to netcf (via Matahari)?
I'm not sure how does netcf handle unstable interface names, seems that it relies on them being stable which is not the case in the stateless environment like oVirt Node.
Alan
13 years, 5 months
testing framework
by Adam Stokes
Hi all,
I'd like to start looking into adding a testing framework and so far I think cppunit is a good choice. Any objections/alternatives?
Thanks,
Adam
13 years, 5 months
sigar test
by Adam Stokes
Some testing output from sigar.
java -jar sigar-bin/lib/sigar.jar
Loaded rc file: ./.sigar_shellrc
sigar> help
Available commands:
alias - Create alias command
cpuinfo - Display cpu information
df - Report filesystem disk space usage
du - Display usage for a directory recursively
free - Display information about free and used memory
get - Get system properties
help - Gives help on shell commands
ifconfig - Network interface information
iostat - Report filesystem disk i/o
kill - Send signal to a process
ls - simple FileInfo test at the moment (like ls -l)
mps - Show multi process status
netinfo - Display network info
netstat - Display network connections
nfsstat - Display nfs stats
pargs - Show process command line arguments
penv - Show process environment
pfile - Display process file info
pidof - Find the process ID of a running program
pinfo - Display all process info
pmodules - Display process module info
ps - Show process status
quit - Terminate the shell
route - Kernel IP routing table
set - Set system properties
sleep - Delay execution for the a number of seconds
source - Read a file, executing the contents
sysinfo - Display system information
time - Time command
ulimit - Display system resource limits
uptime - Display how long the system has been running
version - Display sigar and system version info
who - Show who is logged on
sigar> ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2097438 errors:0 dropped:0 overruns:0 frame:0
TX packets:2097438 errors:0 dropped:0 overruns:0 carrier:0
collisions:0
RX bytes:437264670 (417M) TX bytes:437264670 (417M)
wlan0 Link encap:Ethernet HWaddr 00:1C:BF:8A:DC:B2
inet addr:192.168.5.134 Bcast:192.168.5.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1492 Metric:1
RX packets:2087979 errors:0 dropped:0 overruns:0 frame:0
TX packets:1284336 errors:0 dropped:0 overruns:0 carrier:0
collisions:0
RX bytes:2570840991 (2.4G) TX bytes:309761423 (295M)
tun0 Link encap:Ethernet
inet addr:10.3.113.45 P-t-P:255.255.255.0 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:2106 errors:0 dropped:0 overruns:0 frame:0
TX packets:1843 errors:0 dropped:0 overruns:0 carrier:0
collisions:0
RX bytes:2266008 (2.2M) TX bytes:168653 (165K)
eth0 Link encap:Ethernet HWaddr 00:1E:37:88:38:42
inet addr:0.0.0.0 Bcast:0.0.0.0 Mask:0.0.0.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0
RX bytes:0 ( 0 ) TX bytes:0 ( 0 )
sigar> netinfo
primary interface.....wlan0
primary ip address....192.168.5.134
primary mac address...00:1C:BF:8A:DC:B2
primary netmask.......255.255.255.0
host name.............localhost.localdomain
domain name...........(none)
default gateway.......192.168.5.1
primary dns...........172.16.52.28
secondary dns.........10.11.255.27
sigar> netinfo wlan0
netinfo: Syntax: netinfo
sigar> netinfo
primary interface.....wlan0
primary ip address....192.168.5.134
primary mac address...00:1C:BF:8A:DC:B2
primary netmask.......255.255.255.0
host name.............localhost.localdomain
domain name...........(none)
default gateway.......192.168.5.1
primary dns...........172.16.52.28
secondary dns.........10.11.255.27
My thoughts is that it provides most of the stuff Matahari does at this time and
I didn't find a way to actually administer a device (shutdown network interfaces).
I honestly do not see a major benefit of including this library (perhaps some code
snippets at best).
--
__ __
.-----.| |_.-----.| |--.-----.-----.
|__ --|| _| _ || <| -__|__ --|
|_____||____|_____||__|__|_____|_____|
.----------------------------------.
( ajs(a)redhat.com || 919.754.4187 )
`----------------------------------'
13 years, 5 months
Fwd: Re: PackageKit in Matahari
by Jaroslav Reznik
Hi,
this is a reply from Hughsie regarding packaging API.
---------- Forwarded Message ----------
Subject: Re: PackageKit in Matahari
Date: Thursday, November 25, 2010, 10:27:13 am
From: Richard Hughes <rhughes(a)redhat.com>
To: Jaroslav Reznik <jreznik(a)redhat.com>
----- "Jaroslav Reznik" <jreznik(a)redhat.com> wrote:
> Hi Richard,
> we're working on Matahari [1] projects - in short summary - it's a set
> of multiplatform agents exposing QMF/DBus interfaces remotely/localy.
> We'd like to have very simple packaging agent in place. That means, we do not
aim
> complex package abstraction layer as PackageKit is (for example because of
> Windows). But the question is - is it suitable to use PackageKit in this
scenario?
> On servers where's no PackageKit available, we can directly talk to yum but on
> desktops (we have to support desktops in clustered/cloud environments too) -
we're
> worried about interaction with PackageKit (as it usually used there and
> usually is running) and it can lead to conflicts - like locks etc. What's your
> opinion, recomendation for us?
Hey, thanks for the email. Honestly, I think if you want to do a multiplatform
package abstraction, you want to be using PackageKit. PackageKit already
compiles on windows, although no backend already exists for windows currently.
It certainly wouldn't be hard to build a msi-based backend for PackageKit and
then it's a complete solution.
The obvious answer aside, is the more general point. If you have 'n' programs
all trying to use 1 non-parallel packaging framework (apt, yum, whatever) then
there is going to be be contentions and locks. You can't assume your project is
more high profile than other projects and just lock them out, for instance, if
Matahari is being used on a desktop, and the the user goes to use the command-
not-found feature in bash, the bash prompt will stall as yum has the lock in
another process. I believe the only way to deal with these limited "1 at a time"
resources is with a queued daemon, where different transactions are scheduled
according to the interaction mode and run with the desired latencies.
I think the correct thing to do, in my opinion of course, would be to use
PackageKit as the packaging abstraction and avoid re-inventing the wheel.
PackageKit has a ridiculously simple API compared to all of the other packaging
APIs, and I always fight hard to keep it that way; that said, if it's missing a
feature that people need we normally work pretty hard to get it supported on all
distros. I don't think you can design a package abstraction any simpler,
especially when it comes to returning localised results using user-specific
network proxies, and dealing with interactions like PolicyKit, trusted packages,
GPG and EULA dialogs.
Also, from someone that spend a lot of time looking at yum bugreports filed
against PackageKit, I would really advise against using yum directly. You really
have to hold it's hand at every step and keep a keen eye on the upstream yum
tree for API and ABI breaks. Long term I'm aiming to phase out yum use from
PackageKit and use a direct framework instead, just because of the constant API
breaks and unpredictability.
If you want, grab me on IRC, nick "hughsie".
Richard.
-----------------------------------------
--
Jaroslav Řezník <jreznik(a)redhat.com>
Software Engineer - Base Operating Systems Brno
Office: +420 532 294 275
Mobile: +420 602 797 774
Red Hat, Inc. http://cz.redhat.com/
13 years, 5 months
cmake bugs?
by Roman Rakus
Looks like there is a bug in CMakeLists.txt. Please note I'm not
familiar with cmake, but;
First I try to run `cmake .' in next branch:
$ cmake .
Library libvirt not found
Library udev_new not found
CMake Error at src/CMakeLists.txt:151 (string):
string sub-command STRIP requires two arguments.
CMake Error at src/CMakeLists.txt:152 (string):
string sub-command REGEX, mode REPLACE needs at least 6 arguments
total to
command.
CMake Error at src/CMakeLists.txt:153 (string):
string sub-command REGEX, mode REPLACE needs at least 6 arguments
total to
command.
CMake Error at src/CMakeLists.txt:170 (message):
QPIDTYPES library not found.
-- Configuring incomplete, errors occurred!
I'm not sure, but is there missing check for some qpid package? I
checked the matahari.spec file and installed qpid-cpp-server-devel. Run
once again cmake:
$ cmake .
Library libvirt not found
Library udev_new not found
CMake Error at src/CMakeLists.txt:170 (message):
QPIDTYPES library not found.
-- Configuring incomplete, errors occurred!
Any other missing package? Also I have libvirt library installed. Not
sure about udev:
$ rpm -qa 'libvirt*' 'udev*'
libvirt-0.8.2-1.fc13.x86_64
libvirt-python-0.8.2-1.fc13.x86_64
libvirt-client-0.8.2-1.fc13.x86_64
libvirt-devel-0.8.2-1.fc13.x86_64
udev-153-4.fc13.x86_64
RR
13 years, 5 months
Re: [Matahari] [netcf-devel] Updating oVirt Server to the latest Matahari 0.4.0 schema
by apevec@redhat.com
On 11/12/2010 08:08 PM, Laine Stump wrote:
> On 11/12/2010 08:24 AM, Alan Pevec wrote:
>> Matahari now basically wraps netcf calls in its network agent, so properties like MAC are not directly available, it can be extracted from netcf XML, output of the 'describe' method.
>>
>> But there's more to it since, netcf can also configure interfaces (not yet in Matahari schema, but it is planned).
>> Currently, ovirt-server provides network configuration which is downloaded by the Node on boot and applied (via augeas).
>> Question is should ovirt-server switch fully to netcf (via Matahari)?
>> I'm not sure how does netcf handle unstable interface names, seems that it relies on them being stable which is not the case in the stateless environment like oVirt Node.
>
> I don't know if this description helps answer your question, but : each
> time netcf is run (actually, each time a netcf API is called, via the
> magic of checking file timestamps) the complete config is reread from
> the standard network config files and the XML is reconstructed as
> necessary. netcf has no config of its own to potentially conflict with
> the system config, nor to modify/update it.
>
> I'm not sure exactly what you mean by "unstable", though. Can you expand?
Ah ok, so it relies on network config files i.e. it won't discover unconfigured but present NICs and also it won't show mac@address if HWADDR is not present in ifcfg file.
Matahari then needs to keep the code for enumerating NICs at the lower level, to support stateless Node.
By "unstable" I mean that eth* device names are not consistent across reboots, solution for which was discussed at LPC last week http://linux.dell.com/files/presentations/Linux_Plumbers_Conf_2010/matt-d... )
Without persistent ifcfg-eth* files, like with stateless oVirt Node, multiple NICs will come in random order.
Alan
13 years, 5 months
qpid/qmf and C
by Perry Myers
Ted,
We've discussed this in the past, but it's come up recently in a different
context, so I wanted to reopen the issue.
The qemu upstream community wants to implement a host to guest
API/transport. We started talking to them about Matahari + QMF over
virtio-serial and are blocked on a specific issue...
QMF Consoles need to be written in C++ (or other higher level languages).
qemu is written in C. The qemu team wants to put the host side of the
functionality into the qemu process itself. For example, qemu would
invoke a guest API call for things like sync-filesystem, reboot, etc
Using QMF, they would need to have a QMF Console written in C++, but
integrated into the C based qemu code. This is problematic for them, and
likely will be problematic for anyone wanting to use Matahari but tied to
C on the Console side.
What we discussed in the past was:
1. Implement a C wrapper on top of the C++ QMF APIs. This would allow
someone to mostly write in C, but they would need to compile C++ code
(or at least link to it)
2. Implement the qpid and QMF Console code in C, and use that as the base
language to create C++, python, etc, wrappers. This would be more
efficient for maintaining multiple language bindings rather than
having each language be a complete re-implementation
Understood that #2 is a challenge (resource constraints), but if we could
provide #1 in the short term, that might help satisfy the qemu community
and get them on board with Matahari.
Thoughts?
Perry
13 years, 5 months
[PATCH 1/6] Consolidated qmf schema's
by Adam Stokes
- In order for package generation to pull in required schema classes
I consolidated so that it would generate 1 package file with the proper
includes. Otherwise they were overwriting themselves
---
src/schema-host.xml | 37 ----------------------
src/schema-net.xml | 45 ---------------------------
src/schema.xml | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 84 insertions(+), 82 deletions(-)
delete mode 100644 src/schema-host.xml
delete mode 100644 src/schema-net.xml
create mode 100644 src/schema.xml
diff --git a/src/schema-host.xml b/src/schema-host.xml
deleted file mode 100644
index 4392be4..0000000
--- a/src/schema-host.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<schema package="com.redhat.matahari.host">
-
- <class name="Host">
- <!-- properties -->
- <property name="uuid" type="sstr" access="RO" desc="Host UUID" index="y" />
- <property name="hostname" type="sstr" access="RO" desc="Hostname" />
- <property name="is_virtual" type="bool" access="RO" desc="Is this machine virtual?" />
- <property name="operating_system" type="sstr" access="RO" desc="The installed operating system." />
- <property name="memory" type="int64" access="RO" desc="Amount of primary memory for host (kb)" unit="kb" />
- <property name="arch" type="sstr" access="RO" desc="Architecture of host" />
- <property name="hypervisor" type="sstr" access="RO" desc="Hypervisor used by host" />
- <property name="platform" type="uint8" access="RO" desc="The wordsize for the host." unit="bit"/>
- <property name="processors" type="uint8" access="RO" desc="The number of physical CPUs." />
- <property name="cores" type="uint8" access="RO" desc="The total number of processor cores." />
- <property name="model" type="lstr" access="RO" desc="The processor(s) model description." />
-
- <!-- statistics -->
- <statistic name="last_updated_seq" type="uint32" desc="The heartbeat sequence number." />
- <statistic name="last_updated" type="absTime" desc="The last time a heartbeat occurred." />
- <statistic name="load_average_1" type="double" desc="The one minute load average." />
- <statistic name="load_average_5" type="double" desc="The five minute load average." />
- <statistic name="load_average_15" type="double" desc="The fiften minute load average" />
-
- <!-- APIs -->
- <method name="identify" desc="Tells the host to beep its pc speaker." />
- <method name="shutdown" desc="Shutdown node" />
- <method name="reboot" desc="Reboot node" />
- </class>
-
- <eventArguments>
- <arg name="timestamp" type="absTime" />
- <arg name="sequence" type="uint32" />
- </eventArguments>
-
- <event name="heartbeat" args="timestamp,sequence" />
-
-</schema>
diff --git a/src/schema-net.xml b/src/schema-net.xml
deleted file mode 100644
index 01a2517..0000000
--- a/src/schema-net.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<!-- https://cwiki.apache.org/qpid/qpid-management-framework.html -->
-<schema package="com.redhat.matahari.net">
- <class name="Network">
- <property name="hostname" type="sstr" access="RO" desc="Hostname" index="y"/>
-
- <!-- APIs -
- <method name="identify" desc="Tell network device to blink light"/>
- <method name="add_address" desc="Applies new IP address to device">
- <arg name="address" dir="IO" type="uint32" />
- <arg name="netmask" dir="IO" type="uint32" />
- <arg name="intf" dir="IO" type="sstr" />
- </method>
- <method name="remove_address" desc="Remove IP address"/>
- <method name="list_dns_servers" desc="List of DNS servers">
- <arg name="iface" dir="IO" type="sstr" />
- </method-->
-
- <method name="list" desc="List IP addresses">
- <arg name="max" dir="O" type="uint32" />
- <arg name="iface_map" dir="O" type="map" /> <!-- Use a list when 0.7 becomes available -->
- </method>
-
- <method name="destroy" desc="Remove network interface">
- <arg name="iface" dir="I" type="sstr" />
- </method>
-
- <method name="start" desc="Start a network interface">
- <arg name="iface" dir="I" type="sstr" />
- <arg name="status" dir="O" type="uint32" />
- </method>
- <method name="stop" desc="Stop a network interface">
- <arg name="iface" dir="I" type="sstr" />
- <arg name="status" dir="O" type="uint32" />
- </method>
- <method name="status" desc="Check a network interface">
- <arg name="iface" dir="I" type="sstr" />
- <arg name="status" dir="O" type="uint32" />
- </method>
- <method name="describe" desc="Obtain XML description of a network interface status">
- <arg name="iface" dir="I" type="sstr" />
- <arg name="xml" dir="O" type="sstr" />
- </method>
- </class>
-
-</schema>
diff --git a/src/schema.xml b/src/schema.xml
new file mode 100644
index 0000000..5bddf9f
--- /dev/null
+++ b/src/schema.xml
@@ -0,0 +1,84 @@
+<schema package="com.redhat.matahari">
+
+<!-- HOST SCHEMA -->
+ <class name="Host">
+ <!-- properties -->
+ <property name="uuid" type="sstr" access="RO" desc="Host UUID" index="y" />
+ <property name="hostname" type="sstr" access="RO" desc="Hostname" />
+ <property name="is_virtual" type="bool" access="RO" desc="Is this machine virtual?" />
+ <property name="operating_system" type="sstr" access="RO" desc="The installed operating system." />
+ <property name="memory" type="uint32" access="RO" desc="Amount of primary memory for host (kb)" unit="kb" />
+ <property name="swap" type="uint32" access="RO" desc="Amount of swap for host (kb)" unit="kb" />
+ <property name="arch" type="sstr" access="RO" desc="Architecture of host" />
+ <property name="hypervisor" type="sstr" access="RO" desc="Hypervisor used by host" />
+ <property name="platform" type="uint8" access="RO" desc="The wordsize for the host." unit="bit"/>
+ <property name="processors" type="uint8" access="RO" desc="The number of physical CPUs." />
+ <property name="cores" type="uint8" access="RO" desc="The total number of processor cores." />
+ <property name="model" type="lstr" access="RO" desc="The processor(s) model description." />
+
+ <!-- statistics -->
+ <statistic name="last_updated_seq" type="uint32" desc="The heartbeat sequence number." />
+ <statistic name="last_updated" type="absTime" desc="The last time a heartbeat occurred." />
+ <statistic name="load_average_1" type="double" desc="The one minute load average." />
+ <statistic name="load_average_5" type="double" desc="The five minute load average." />
+ <statistic name="load_average_15" type="double" desc="The fiften minute load average" />
+ <statistic name="memFree" type="uint32" desc="Amount of available memory for host (kb)" />
+ <statistic name="swapFree" type="uint32" desc="Amount of available swap for host (kb)" />
+ <statistic name="procTotal" type="uint32" desc="Total processes" />
+ <statistic name="procRunning" type="uint32" desc="Total running processes" />
+ <!-- APIs -->
+ <method name="identify" desc="Tells the host to beep its pc speaker." />
+ <method name="shutdown" desc="Shutdown node" />
+ <method name="reboot" desc="Reboot node" />
+ </class>
+
+ <eventArguments>
+ <arg name="timestamp" type="absTime" />
+ <arg name="sequence" type="uint32" />
+ </eventArguments>
+
+ <event name="heartbeat" args="timestamp,sequence" />
+
+ <!-- NETWORK SCHEMA -->
+ <class name="Network">
+ <property name="hostname" type="sstr" access="RO" desc="Hostname" index="y"/>
+
+ <!-- APIs -
+ <method name="identify" desc="Tell network device to blink light"/>
+ <method name="add_address" desc="Applies new IP address to device">
+ <arg name="address" dir="IO" type="uint32" />
+ <arg name="netmask" dir="IO" type="uint32" />
+ <arg name="intf" dir="IO" type="sstr" />
+ </method>
+ <method name="remove_address" desc="Remove IP address"/>
+ <method name="list_dns_servers" desc="List of DNS servers">
+ <arg name="iface" dir="IO" type="sstr" />
+ </method-->
+
+ <method name="list" desc="List IP addresses">
+ <arg name="max" dir="O" type="uint32" />
+ <arg name="iface_map" dir="O" type="list" />
+ </method>
+
+ <method name="destroy" desc="Remove network interface">
+ <arg name="iface" dir="I" type="sstr" />
+ </method>
+
+ <method name="start" desc="Start a network interface">
+ <arg name="iface" dir="I" type="sstr" />
+ <arg name="status" dir="O" type="uint32" />
+ </method>
+ <method name="stop" desc="Stop a network interface">
+ <arg name="iface" dir="I" type="sstr" />
+ <arg name="status" dir="O" type="uint32" />
+ </method>
+ <method name="status" desc="Check a network interface">
+ <arg name="iface" dir="I" type="sstr" />
+ <arg name="status" dir="O" type="uint32" />
+ </method>
+ <method name="describe" desc="Obtain XML description of a network interface status">
+ <arg name="iface" dir="I" type="sstr" />
+ <arg name="xml" dir="O" type="sstr" />
+ </method>
+ </class>
+</schema>
--
1.7.2.3
13 years, 5 months