From: Adam Stokes astokes@fedoraproject.org
- Config agent will provide a method for telling the Console agent if it was configured or not. At this time it creates a file /tmp/.mh_configured and tests if this file exists and responds accordingly. - Console agent monitors when an Agent connects and will query that agent to make sure it is of class: Config under package:org.matahariproject. If that is the case it will then invoke the method configure on the agent which provides the above response.
Pretty straight forward and we can expand on arguements or other methods if needed. --- src/CMakeLists.txt | 2 ++ src/lib/CMakeLists.txt | 6 +++++- src/schema.xml | 12 ++++++++++-- 3 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b55f339..dfc2fa6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -117,6 +117,8 @@ add_subdirectory(lib) add_subdirectory(host) add_subdirectory(network) add_subdirectory(service) +add_subdirectory(console) +add_subdirectory(config)
### Installation install(FILES ${SCHEMAS} DESTINATION share/matahari) diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index 2538517..38485d3 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -1,6 +1,6 @@ # Library
-set(LIBS mcommon mhost mnetwork mservice) +set(LIBS mcommon mhost mnetwork mservice mconfig) include_directories(${pcre_INCLUDE_DIRS})
add_library (mcommon SHARED utilities.c mainloop.c) @@ -19,6 +19,10 @@ add_library (mservice SHARED services.c services_${VARIANT}.c) set_target_properties(mservice PROPERTIES SOVERSION 0.0.1) target_link_libraries(mservice ${pcre_LIBRARIES} mcommon ${SIGAR} ${glib_LIBRARIES})
+add_library (mconfig SHARED mh_agent_config.c) +set_target_properties(mconfig PROPERTIES SOVERSION 0.0.1) +target_link_libraries(mconfig ${pcre_LIBRARIES} mcommon ${glib_LIBRARIES}) + if(WIN32) foreach (lib ${LIBS}) target_link_libraries(${lib} wsock32) diff --git a/src/schema.xml b/src/schema.xml index ea82e4f..8446490 100644 --- a/src/schema.xml +++ b/src/schema.xml @@ -90,7 +90,7 @@ <arg name="iface" dir="I" type="sstr" /> <arg name="status" dir="O" type="uint32" /> </method> - <method name="get_ip_address" desc="Obtain ip addressof a network interface"> + <method name="get_ip_address" desc="Obtain ip address of a network interface"> <arg name="iface" dir="I" type="sstr" /> <arg name="ip" dir="O" type="sstr" /> </method> @@ -243,5 +243,13 @@ <arg name="timeout" dir="O" type="uint32" /> </method--> </class> - + + <event name="configure_me" args="ip,sequence,timestamp" /> + + <class name="Config"> + <property name="uuid" type="sstr" access="RO" desc="Host UUID" /> + <property name="hostname" type="sstr" access="RO" desc="Hostname" index="y"/> + <property name="configured" type="uint32" access="RO" desc="Am I configured?" /> + <method name="configure" desc="Send configure method" /> + </class> </schema>