cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] conga ./clustermon.spec.in.in ricci/modules/cl ...
@ 2006-12-13 19:14 kupcevic
  0 siblings, 0 replies; 5+ messages in thread
From: kupcevic @ 2006-12-13 19:14 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	kupcevic at sourceware.org	2006-12-13 19:14:54

Modified files:
	.              : clustermon.spec.in.in 
	ricci/modules/cluster/clumon/src/daemon: Monitor.cpp 

Log message:
	Improved bz218941: Conga/luci - cannot add node to cluster via luci web app

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/clustermon.spec.in.in.diff?cvsroot=cluster&r1=1.24&r2=1.25
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/clumon/src/daemon/Monitor.cpp.diff?cvsroot=cluster&r1=1.12&r2=1.13

--- conga/clustermon.spec.in.in	2006/11/17 20:39:42	1.24
+++ conga/clustermon.spec.in.in	2006/12/13 19:14:53	1.25
@@ -195,13 +195,13 @@
 
 %changelog
 
-* day month date 2006 Stanko Kupcevic <kupcevic@redhat.com> 0.9.1-2
+* Tue Dec 12 2006 Stanko Kupcevic <kupcevic@redhat.com> 0.9.1-2
 
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 XXXXXXXXXXXXXXXXXXX UPDATE NOT RELEASED YET XXXXXXXXXXXXXXXXXXX
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
-- 
+- Improved bz218941: Conga/luci - cannot add node to cluster via luci web app
 
 
 
--- conga/ricci/modules/cluster/clumon/src/daemon/Monitor.cpp	2006/10/24 14:56:56	1.12
+++ conga/ricci/modules/cluster/clumon/src/daemon/Monitor.cpp	2006/12/13 19:14:54	1.13
@@ -269,7 +269,9 @@
   msg = generateXML(msg_xml);
   
   // return nodes - nodename
-  nodes.erase(find(nodes.begin(), nodes.end(), nodename));
+  vector<String>::iterator iter = find(nodes.begin(), nodes.end(), nodename);
+  if (iter != nodes.end())
+    nodes.erase(iter);
   return nodes;
 }
 



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Cluster-devel] conga ./clustermon.spec.in.in ricci/modules/cl ...
@ 2007-10-09 19:58 rmccabe
  0 siblings, 0 replies; 5+ messages in thread
From: rmccabe @ 2007-10-09 19:58 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2007-10-09 19:58:30

Modified files:
	.              : clustermon.spec.in.in 
	ricci/modules/cluster: ClusterStatus.cpp 
	ricci/modules/cluster/clumon/src/cim-provider: Makefile 
	ricci/modules/cluster/clumon/src/common: Cluster.cpp 
	ricci/modules/cluster/clumon/src/daemon: Makefile Monitor.cpp 
	                                         Monitor.h main.cpp 
	ricci/modules/cluster/clumon/src/snmp-agent: Makefile 

Log message:
	use libcman wherever possible instead of fork/exec and parsing stdout

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/clustermon.spec.in.in.diff?cvsroot=cluster&r1=1.32&r2=1.33
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/ClusterStatus.cpp.diff?cvsroot=cluster&r1=1.23&r2=1.24
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/clumon/src/cim-provider/Makefile.diff?cvsroot=cluster&r1=1.7&r2=1.8
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/clumon/src/common/Cluster.cpp.diff?cvsroot=cluster&r1=1.8&r2=1.9
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/clumon/src/daemon/Makefile.diff?cvsroot=cluster&r1=1.8&r2=1.9
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/clumon/src/daemon/Monitor.cpp.diff?cvsroot=cluster&r1=1.18&r2=1.19
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/clumon/src/daemon/Monitor.h.diff?cvsroot=cluster&r1=1.8&r2=1.9
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/clumon/src/daemon/main.cpp.diff?cvsroot=cluster&r1=1.8&r2=1.9
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/clumon/src/snmp-agent/Makefile.diff?cvsroot=cluster&r1=1.6&r2=1.7

--- conga/clustermon.spec.in.in	2007/09/20 05:36:13	1.32
+++ conga/clustermon.spec.in.in	2007/10/09 19:58:29	1.33
@@ -27,6 +27,7 @@
 Source0: %{name}-%{version}.tar.gz
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
+BuildRequires: cman-devel
 BuildRequires: glibc-devel gcc-c++ libxml2-devel
 BuildRequires: openssl-devel dbus-devel pam-devel pkgconfig
 BuildRequires: net-snmp-devel tog-pegasus-devel
--- conga/ricci/modules/cluster/ClusterStatus.cpp	2007/09/28 04:47:56	1.23
+++ conga/ricci/modules/cluster/ClusterStatus.cpp	2007/10/09 19:58:29	1.24
@@ -150,7 +150,8 @@
 	{
 		XMLObject s(*iter);
 		if (s.tag() == "service")
-			s.set_attr("vm", (is_service_vm(cluster_conf, s.get_attr("name"))) ? "true" : "false");
+			s.set_attr("vm", (is_service_vm(cluster_conf,
+								s.get_attr("name"))) ? "true" : "false");
 		status_new.add_child(s);
 	}
 	return status_new;
--- conga/ricci/modules/cluster/clumon/src/cim-provider/Makefile	2007/09/18 21:21:52	1.7
+++ conga/ricci/modules/cluster/clumon/src/cim-provider/Makefile	2007/10/09 19:58:30	1.8
@@ -57,7 +57,7 @@
 
 INCLUDE += -I ../include
 CXXFLAGS += $(PEGASUS_CXXFLAGS) -DPARANOIA=$(PARANOID)
-LDFLAGS += -shared -ldl -lcrypt
+LDFLAGS += -shared -ldl -lcrypt -lcman
 
 ifeq ($(PARANOID), 1)
 	LDFLAGS += ${top_srcdir}/common/paranoid/*.o
@@ -88,7 +88,7 @@
 rebuild: clean all
 
 $(TARGET): $(OBJECTS)
-	$(CXX) $(LDFLAGS) -o $@ $(OBJECTS)
+	$(CXX) -o $@ $(OBJECTS) $(LDFLAGS) 
 
 $(TARGET_TEST): clusterCIM_test.*
 	$(CXX) $(CXXFLAGS) -lpegcommon -lpegclient -lpthread -lcrypt -o $@ $@.cpp
--- conga/ricci/modules/cluster/clumon/src/common/Cluster.cpp	2007/09/18 20:16:26	1.8
+++ conga/ricci/modules/cluster/clumon/src/common/Cluster.cpp	2007/10/09 19:58:30	1.9
@@ -24,6 +24,10 @@
 
 #include <stdio.h>
 
+extern "C" {
+#	include <libcman.h>
+}
+
 using namespace std;
 using namespace ClusterMonitoring;
 
@@ -65,6 +69,19 @@
 unsigned int
 Cluster::votes()
 {
+	cman_handle_t ch = cman_init(NULL);
+	if (ch != NULL) {
+		char info[PIPE_BUF];
+		cman_extra_info_t *cman_ei = (cman_extra_info_t *) info;
+		unsigned int total_votes = 0;
+
+		if (cman_get_extra_info(ch, cman_ei, sizeof(info)) == 0)
+			total_votes = cman_ei->ei_total_votes;
+		cman_finish(ch);
+		if (total_votes > 0)
+			return (total_votes);
+	}
+
 	unsigned int votes = 0;
 	for (map<String, counting_auto_ptr<Node> >::iterator
 			iter = _nodes.begin() ;
@@ -81,6 +98,20 @@
 unsigned int
 Cluster::minQuorum()
 {
+	cman_handle_t ch = cman_init(NULL);
+	if (ch != NULL) {
+		char info[PIPE_BUF];
+		cman_extra_info_t *cman_ei = (cman_extra_info_t *) info;
+		int minq = -1;
+
+		if (cman_get_extra_info(ch, cman_ei, sizeof(info)) == 0)
+			minq = cman_ei->ei_quorum;
+		cman_finish(ch);
+
+		if (minq != -1)
+			return minq;
+	}
+
 	if (_minQuorum != 0)
 		return _minQuorum;
 	else {
@@ -101,6 +132,13 @@
 bool
 Cluster::quorate()
 {
+	cman_handle_t ch = cman_init(NULL);
+	if (ch != NULL) {
+		int quorate = cman_is_quorate(ch);
+		cman_finish(ch);
+		return quorate;
+	}
+
 	return votes() >= minQuorum();
 }
 
--- conga/ricci/modules/cluster/clumon/src/daemon/Makefile	2007/09/11 02:42:50	1.8
+++ conga/ricci/modules/cluster/clumon/src/daemon/Makefile	2007/10/09 19:58:30	1.9
@@ -20,7 +20,7 @@
 	Peer.o \
 	Communicator.o
 
-INCLUDE += -I ../include
+INCLUDE += -I../include
 CXXFLAGS += -DPARANOIA=$(PARANOID)
 LDFLAGS += ../common/*.o
 
@@ -30,6 +30,8 @@
 	LDFLAGS += ${top_srcdir}/common/*.o
 endif
 
+LDFLAGS += -lcman
+
 all: ${TARGET}
 
 install:
@@ -49,4 +51,4 @@
 *.o: *.h
 
 $(TARGET): $(OBJECTS)
-	$(CXX) -o $@ $(LDFLAGS) $(OBJECTS)
+	$(CXX) -o $@ $(OBJECTS) $(LDFLAGS)
--- conga/ricci/modules/cluster/clumon/src/daemon/Monitor.cpp	2007/09/18 20:16:27	1.18
+++ conga/ricci/modules/cluster/clumon/src/daemon/Monitor.cpp	2007/10/09 19:58:30	1.19
@@ -25,7 +25,6 @@
 #include "Logger.h"
 #include "Time.h"
 #include "utils.h"
-#include "Network.h"
 
 #include <sys/poll.h>
 #include <sys/sysinfo.h>
@@ -54,9 +53,9 @@
 static String cluster_version();
 static String get_cman_tool_path();
 
-Monitor::Monitor(unsigned short port) :
+Monitor::Monitor(unsigned short port, const String& ver) :
 	_comm(port, *this),
-	_cl_version(cluster_version()),
+	_cl_version(ver.size() ? ver : cluster_version()),
 	_cman_tool_path(get_cman_tool_path()),
 	_cman_locking(_cl_version == "5")
 {
@@ -550,44 +549,53 @@
 }
 */
 
-/*
-** FIXME: rewrite this to use libcman.
-*/
 vector<String>
 Monitor::clustered_nodes()
 {
 	vector<String> running;
 
 	if (_cman_locking) {
-		String out, err;
-		int status;
-		vector<String> args;
-		args.push_back("nodes");
-
-		if (execute(_cman_tool_path, args, out, err, status, EXECUTE_TIMEOUT))
-			throw String("clustered_nodes(): missing cman_tool");
-		if (status)
-			return vector<String>();
+		int ret_nodes = -1;
+		int ret;
+		cman_node_t *node_array;
+
+		cman_handle_t ch = cman_init(NULL);
+		if (ch == NULL)
+			throw String("Unable to communicate with cman");
+
+		ret = cman_get_node_count(ch);
+		if (ret <= 0) {
+			cman_finish(ch);
+			throw String("Unable to communicate with cman");
+		}
+	
+		node_array = (cman_node_t *) malloc(sizeof(*node_array) * ret);
+		if (node_array == NULL) {
+			cman_finish(ch);
+			throw String("Out of memory");
+		}
+
+		if (cman_get_nodes(ch, ret, &ret_nodes, node_array) != 0) {
+			cman_finish(ch);
+			free(node_array);
+			throw String("Unable to communicate with cman");
+		}
+		cman_finish(ch);
 
-		vector<String>::size_type Sts_idx = 0;
-		vector<String> lines = utils::split(out, "\n");
-		for (vector<String>::iterator
-				iter = lines.begin() ;
-				iter != lines.end() ;
-				iter++)
-		{
-			vector<String> words = utils::split(utils::strip(*iter));
-			if (words.size() < Sts_idx+1)
-				continue;
-			if (words[0] == "Node") {
-				// update Sts_idx
-				for (vector<String>::size_type i = 0 ; i < words.size() ; i++) {
-					if (words[i] == "Sts")
-						Sts_idx = i;
+		try {
+			for (int i = 0 ; i < ret_nodes ; i++) {
+				if (node_array[i].cn_nodeid == 0) {
+					/* qdisk */;
+					continue;
 				}
-			} else if (words[Sts_idx] == "M")
-				running.push_back(words.back());
+				if (node_array[i].cn_member)
+					running.push_back(String(node_array[i].cn_name));
+			}
+		} catch (...) {
+			free(node_array);
+			throw;
 		}
+		free(node_array);
 	} else if (_cl_version == "4") {
 		String out, err;
 		int status;
@@ -625,61 +633,56 @@
 String
 Monitor::nodename(const vector<String>& nodenames)
 {
-	if (_cman_locking) {
-		String out, err;
-		int status;
-
-		vector<String> args(1, "status");
-		if (execute(_cman_tool_path, args, out, err, status, EXECUTE_TIMEOUT))
-			throw String("nodename(): missing ") + _cman_tool_path;
-
-		if (status) {
-			// cman not running, match using address
-			out.clear();
-		}
+	struct ifaddrs *if_list = NULL;
+	struct addrinfo hints;
 
-		vector<String> lines = utils::split(utils::strip(out), "\n");
-		for (vector<String>::const_iterator
-				iter = lines.begin() ;
-				iter != lines.end() ;
-				iter++)
-		{
-			vector<String> words = utils::split(utils::strip(*iter));
-			if (words.size() != 3)
-				continue;
-
-			if (words[0] + " " + words[1] == "Node name:")
-				return words[2];
+	if (_cman_locking) {
+		cman_handle_t ch = cman_init(NULL);
+		if (ch != NULL) {
+			cman_node_t this_node;
+			if (cman_get_node(ch, CMAN_NODEID_US, &this_node) == 0) {
+				cman_finish(ch);
+				return String(this_node.cn_name);
+			}
+			cman_finish(ch);
 		}
 	}
 
-	/* FIXME: REWRITE THIS. */
-	String out, err;
-	int status;
-	if (execute("/sbin/ifconfig", vector<String>(), out, err,
-		status, EXECUTE_TIMEOUT))
-	{
-		throw String("nodename(): missing ifconfig");
-	}
-	if (status)
-		throw String("nodename(): ifconfig failed");
+	if (getifaddrs(&if_list) != 0) 
+		throw ("Unable to determine local node name");
+
+	memset(&hints, 0, sizeof(hints));
+	hints.ai_family = AF_INET;
 
 	for (vector<String>::const_iterator
 			iter = nodenames.begin() ;
 			iter != nodenames.end() ;
 			iter++)
 	{
-		const String& nodename = *iter;
-		vector<String> ips = Network::name2IP(nodename);
-		for (vector<String>::iterator
-				iter_ip = ips.begin() ;
-				iter_ip != ips.end() ;
-				iter_ip++)
-		{
-			if (out.find(*iter_ip) != out.npos)
-				return nodename;
+		struct addrinfo *res;
+		if (getaddrinfo(iter->c_str(), NULL, &hints, &res) == 0) {
+			struct addrinfo *ai;
+			for (ai = res ; ai != NULL ; ai = ai->ai_next) {
+				struct ifaddrs *cur;
+
+				for (cur = if_list ; cur != NULL ; cur = cur->ifa_next) {
+					if (!cur->ifa_addr || !(cur->ifa_flags & IFF_UP))
+						continue;
+					if (cur->ifa_flags & IFF_LOOPBACK)
+						continue;
+					if (cur->ifa_addr->sa_family != AF_INET)
+						continue;
+					if (!memcmp(cur->ifa_addr, ai->ai_addr, ai->ai_addrlen)) {
+						freeaddrinfo(res);
+						freeifaddrs(if_list);
+						return *iter;
+					}
+				}
+			}
+			freeaddrinfo(res);
 		}
 	}
+	freeifaddrs(if_list);
 
 	return "";
 }
@@ -802,31 +805,24 @@
 }
 
 String
-Monitor::probe_quorum() const
+Monitor::probe_quorum()
 {
 	if (_cman_locking) {
-		int status;
-		String out, err;
-		vector<String> args;
-
-		args.push_back("status");
-		if (execute(_cman_tool_path, args, out, err, status, EXECUTE_TIMEOUT))
-			throw _cman_tool_path + " status failed";
-		if (status)
-			throw _cman_tool_path + " status failed";
+		String ret;
 
-		vector<String> lines = utils::split(out, "\n");
-		for (vector<String>::const_iterator
-			iter = lines.begin() ;
-			iter != lines.end() ;
-			iter++)
-		{
-			vector<String> words = utils::split(*iter);
-			if (words.size() < 2)
-				continue;
-			if (words[0] == "Quorum:")
-				return words[1];
+		cman_handle_t ch = cman_init(NULL);
+		if (ch == NULL) {
+			cman_finish(ch);
+			throw String("quorum not found");
 		}
+
+		if (cman_is_quorate(ch))
+			ret = "Quorate";
+		else
+			ret = "Not Quorate";
+
+		cman_finish(ch);
+		return ret;
 	} else {
 		// TODO: implement quorum detection on GULM clusters
 		throw String("GULM quorum detection not yet implemented");
@@ -837,6 +833,32 @@
 String
 cluster_version()
 {
+	cman_handle_t ch = cman_init(NULL);
+
+	if (ch != NULL) {
+		int ret;
+		cman_version_t cman_version;
+		char *clu_version = "";
+
+	    ret = cman_get_version(ch, &cman_version);
+		if (ret >= 0) {
+			if (cman_version.cv_major == 6)
+				clu_version = "5";
+			else if (cman_version.cv_major == 5)
+				clu_version = "4";
+			else {
+				char version[32];
+				snprintf(version, sizeof(version), "%d.%d.%d",
+					cman_version.cv_major, cman_version.cv_minor,
+					cman_version.cv_patch);
+				cman_finish(ch);
+				throw "unsupported cluster version: " + String(version);
+			}
+		}
+		cman_finish(ch);
+		return (clu_version);
+	}
+
 	int status;
 	String out, err;
 	vector<String> args;
--- conga/ricci/modules/cluster/clumon/src/daemon/Monitor.h	2007/09/18 20:16:27	1.8
+++ conga/ricci/modules/cluster/clumon/src/daemon/Monitor.h	2007/10/09 19:58:30	1.9
@@ -35,11 +35,19 @@
 namespace ClusterMonitoring
 {
 
+extern "C" {
+#	include <sys/socket.h>
+#	include <netdb.h>
+#	include <arpa/inet.h>
+#	include <net/if.h>
+#	include <ifaddrs.h>
+#	include <libcman.h>
+}
 
 class Monitor : public Thread, public CommDP
 {
 	public:
-		Monitor(unsigned short port);
+		Monitor(unsigned short port, const String& cluster_version);
 		virtual ~Monitor();
 
 		String request(const String&);
@@ -74,12 +82,12 @@
 		XMLObject parse_cluster_conf();
 		//bool clustered();
 		//bool quorate();
+		String probe_quorum();
 		String nodename(const std::vector<String>& nodenames);
 		std::vector<String> clustered_nodes();
 		std::vector<XMLObject> services_info();
 
 		String uptime() const;
-		String probe_quorum() const;
 };
 
 
--- conga/ricci/modules/cluster/clumon/src/daemon/main.cpp	2007/09/26 21:35:20	1.8
+++ conga/ricci/modules/cluster/clumon/src/daemon/main.cpp	2007/10/09 19:58:30	1.9
@@ -27,6 +27,8 @@
 
 #include <sys/poll.h>
 #include <errno.h>
+#include <libcman.h>
+
 typedef struct pollfd poll_fd;
 
 extern "C" {
@@ -71,9 +73,20 @@
 	bool debug = false, foreground = false;
 	int v_level = -1;
 	int rv;
+	String clu_version("");
 
-	while ((rv = getopt(argc, argv, "fdv:")) != EOF) {
+	while ((rv = getopt(argc, argv, "c:fdv:")) != EOF) {
 		switch (rv) {
+			case 'c': {
+				char *p;
+				long cv = strtol(optarg, &p, 10);
+				if (*p != '\0' || cv < 3 || cv > 5) {
+					fprintf(stderr, "Invalid cluster version: %s\n", optarg);
+					exit(-1);
+				}
+				clu_version = String(optarg);
+			}
+
 			case 'd':
 				debug = true;
 				break;
@@ -112,7 +125,8 @@
 	try {
 		ServerSocket server(MONITORING_CLIENT_SOCKET);
 		server.nonblocking(true);
-		Monitor monitor(COMMUNICATION_PORT);
+
+		Monitor monitor(COMMUNICATION_PORT, clu_version);
 
 		if (!foreground && (geteuid() == 0))
 			daemon_init(argv[0]);
--- conga/ricci/modules/cluster/clumon/src/snmp-agent/Makefile	2007/09/11 02:42:50	1.6
+++ conga/ricci/modules/cluster/clumon/src/snmp-agent/Makefile	2007/10/09 19:58:30	1.7
@@ -27,6 +27,8 @@
 	LDFLAGS += ${top_srcdir}/common/*.o
 endif
 
+LDFLAGS += -lcman
+
 OBJECTS = clusterMonitorSnmp.o \
 	clusterMIB.o \
 	nodesMIB.o \



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Cluster-devel] conga ./clustermon.spec.in.in ricci/modules/cl ...
@ 2007-11-02  5:44 rmccabe
  0 siblings, 0 replies; 5+ messages in thread
From: rmccabe @ 2007-11-02  5:44 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL4
Changes by:	rmccabe at sourceware.org	2007-11-02 05:44:33

Modified files:
	.              : clustermon.spec.in.in 
	ricci/modules/cluster/clumon/src/snmp-agent: clusterMIB.cpp 
	                                             nodesMIB_access.cpp 
	                                             servicesMIB_access.cpp 

Log message:
	Fix bz334441 (Can't get cluster-snmp (fully) working)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/clustermon.spec.in.in.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.25.2.8&r2=1.25.2.9
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/clumon/src/snmp-agent/clusterMIB.cpp.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.3&r2=1.3.4.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/clumon/src/snmp-agent/nodesMIB_access.cpp.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.2&r2=1.2.4.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/clumon/src/snmp-agent/servicesMIB_access.cpp.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.2&r2=1.2.4.1

--- conga/clustermon.spec.in.in	2007/10/10 18:10:36	1.25.2.8
+++ conga/clustermon.spec.in.in	2007/11/02 05:44:33	1.25.2.9
@@ -195,6 +195,10 @@
 
 
 %changelog
+* Mon Oct 22 2007 Ryan McCabe <rmccabe@redhat.com> 0.11.0-3
+- Fix bz334441 (Can't get cluster-snmp (fully) working)
+- Resolves: bz334441
+
 * Thu Oct 10 2007 Ryan McCabe <rmccabe@redhat.com> 0.11.0-2
 - Fix bz326571: Conga displays quorum status incorrectly when qdisk is used
 - Resolves: bz326571
--- conga/ricci/modules/cluster/clumon/src/snmp-agent/clusterMIB.cpp	2006/08/10 22:53:08	1.3
+++ conga/ricci/modules/cluster/clumon/src/snmp-agent/clusterMIB.cpp	2007/11/02 05:44:33	1.3.4.1
@@ -33,8 +33,8 @@
 using namespace std;
 
 
-static unsigned int getStatusCode(Cluster*);
-static String getStatusDescription(unsigned int code);
+static unsigned long getStatusCode(Cluster*);
+static String getStatusDescription(unsigned long code);
 
 
 void
@@ -213,10 +213,10 @@
 }
 
 
-unsigned int 
+unsigned long 
 getStatusCode(Cluster* cluster)
 {
-  unsigned int code = 1; // OK
+  unsigned long code = 1; // OK
   
   if (cluster->failedServices().size() != 0)
     // service failed
@@ -242,7 +242,7 @@
 }
 
 String
-getStatusDescription(unsigned int code)
+getStatusDescription(unsigned long code)
 {
   if (code == 1)
     return "All services and nodes functional";
@@ -285,7 +285,7 @@
 {
   try {
     
-    unsigned int num = 1;  // MIB version 1
+    unsigned long num = 1;  // MIB version 1
     
     /*
      * We are never called for a GETNEXT if it's registered as a
@@ -330,7 +330,7 @@
     if(cluster.get() == NULL)
       return SNMP_ERR_NOERROR;
     
-    unsigned int num = cluster->failedServices().size();
+    unsigned long num = cluster->failedServices().size();
     
     /*
      * We are never called for a GETNEXT if it's registered as a
@@ -428,7 +428,7 @@
     if(cluster.get() == NULL)
       return SNMP_ERR_NOERROR;
     
-    unsigned int code = getStatusCode(cluster.get());
+    unsigned long code = getStatusCode(cluster.get());
     String str = getStatusDescription(code);
     
     /*
@@ -474,7 +474,7 @@
     if(cluster.get() == NULL)
       return SNMP_ERR_NOERROR;
     
-    unsigned int num = cluster->votes();
+    unsigned long num = cluster->votes();
   
     /*
      * We are never called for a GETNEXT if it's registered as a
@@ -519,7 +519,7 @@
     if(cluster.get() == NULL)
       return SNMP_ERR_NOERROR;
     
-    unsigned int num = cluster->stoppedServices().size();
+    unsigned long num = cluster->stoppedServices().size();
   
     /*
      * We are never called for a GETNEXT if it's registered as a
@@ -617,7 +617,7 @@
     if(cluster.get() == NULL)
       return SNMP_ERR_NOERROR;
     
-    unsigned int num = cluster->clusteredNodes().size();
+    unsigned long num = cluster->clusteredNodes().size();
   
     /*
      * We are never called for a GETNEXT if it's registered as a
@@ -715,7 +715,7 @@
     if(cluster.get() == NULL)
       return SNMP_ERR_NOERROR;
     
-    unsigned int num = cluster->services().size();
+    unsigned long num = cluster->services().size();
   
     /*
      * We are never called for a GETNEXT if it's registered as a
@@ -858,7 +858,7 @@
     if(cluster.get() == NULL)
       return SNMP_ERR_NOERROR;
     
-    unsigned int code = getStatusCode(cluster.get());
+    unsigned long code = getStatusCode(cluster.get());
     
     /*
      * We are never called for a GETNEXT if it's registered as a
@@ -903,7 +903,7 @@
     if(cluster.get() == NULL)
       return SNMP_ERR_NOERROR;
     
-    unsigned int num = cluster->unclusteredNodes().size();
+    unsigned long num = cluster->unclusteredNodes().size();
       
     /*
      * We are never called for a GETNEXT if it's registered as a
@@ -1001,7 +1001,7 @@
     if(cluster.get() == NULL)
       return SNMP_ERR_NOERROR;
     
-    unsigned int num = cluster->nodes().size();
+    unsigned long num = cluster->nodes().size();
   
     /*
      * We are never called for a GETNEXT if it's registered as a
@@ -1099,7 +1099,7 @@
     if(cluster.get() == NULL)
       return SNMP_ERR_NOERROR;
     
-    unsigned int num = cluster->runningServices().size();
+    unsigned long num = cluster->runningServices().size();
     
     /*
      * We are never called for a GETNEXT if it's registered as a
@@ -1198,7 +1198,7 @@
     if(cluster.get() == NULL)
       return SNMP_ERR_NOERROR;
     
-    unsigned int num = cluster->minQuorum();
+    unsigned long num = cluster->minQuorum();
     
     /*
      * We are never called for a GETNEXT if it's registered as a
@@ -1244,7 +1244,7 @@
     if(cluster.get() == NULL)
       return SNMP_ERR_NOERROR;
     
-    unsigned int num = cluster->quorate() ? 1 : 0;
+    unsigned long num = cluster->quorate() ? 1 : 0;
     
     /*
      * We are never called for a GETNEXT if it's registered as a
--- conga/ricci/modules/cluster/clumon/src/snmp-agent/nodesMIB_access.cpp	2006/08/10 22:53:08	1.2
+++ conga/ricci/modules/cluster/clumon/src/snmp-agent/nodesMIB_access.cpp	2007/11/02 05:44:33	1.2.4.1
@@ -40,8 +40,8 @@
 using namespace std;
 
 
-static unsigned int getStatusCode(counting_auto_ptr<Node>);
-static String getStatusDescription(unsigned int code);
+static unsigned long getStatusCode(counting_auto_ptr<Node>);
+static String getStatusDescription(unsigned long code);
 
 
 class LoopContext
@@ -278,7 +278,7 @@
 
 // ## status ##
 
-unsigned int 
+unsigned long 
 getStatusCode(counting_auto_ptr<Node> node)
 {
   if (node->clustered())
@@ -293,7 +293,7 @@
   return 2;
 }
 String 
-getStatusDescription(unsigned int code)
+getStatusDescription(unsigned long code)
 {
   switch(code) {
   case 0:
@@ -337,7 +337,7 @@
     if (node.get() == NULL)
       return NULL;
     
-    unsigned int code = getStatusCode(node);
+    unsigned long code = getStatusCode(node);
     datactx->str_holder = getStatusDescription(code);
     *ret_len = datactx->str_holder.size();
     return (char*) datactx->str_holder.c_str();
--- conga/ricci/modules/cluster/clumon/src/snmp-agent/servicesMIB_access.cpp	2006/08/10 22:53:08	1.2
+++ conga/ricci/modules/cluster/clumon/src/snmp-agent/servicesMIB_access.cpp	2007/11/02 05:44:33	1.2.4.1
@@ -38,8 +38,8 @@
 using namespace std;
 
 
-static unsigned int getStatusCode(counting_auto_ptr<Service>);
-static String getStatusDescription(unsigned int code);
+static unsigned long getStatusCode(counting_auto_ptr<Service>);
+static String getStatusDescription(unsigned long code);
 
 
 
@@ -274,7 +274,7 @@
 
 // ## status ##
 
-unsigned int 
+unsigned long 
 getStatusCode(counting_auto_ptr<Service> service)
 {
   if (service->failed())
@@ -289,7 +289,7 @@
     return 1;
 }
 String 
-getStatusDescription(unsigned int code)
+getStatusDescription(unsigned long code)
 {
   switch(code) {
   case 0:
@@ -333,7 +333,7 @@
     if (service.get() == NULL)
       return NULL;
     
-    unsigned int code = getStatusCode(service);
+    unsigned long code = getStatusCode(service);
     datactx->str_holder = getStatusDescription(code);
     *ret_len = datactx->str_holder.size();
     return (char*) datactx->str_holder.c_str();



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Cluster-devel] conga ./clustermon.spec.in.in ricci/modules/cl ...
@ 2008-03-24 18:13 rmccabe
  0 siblings, 0 replies; 5+ messages in thread
From: rmccabe @ 2008-03-24 18:13 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL5
Changes by:	rmccabe at sourceware.org	2008-03-24 18:13:58

Modified files:
	.              : clustermon.spec.in.in 
	ricci/modules/cluster: Makefile Virt.cpp 

Log message:
	Jump through the requisite hoops to make this compile properly on arches that don't provide libvirt

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/clustermon.spec.in.in.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.18.2.33&r2=1.18.2.34
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/Makefile.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.14.2.5&r2=1.14.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/Virt.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.4&r2=1.1.2.5

--- conga/clustermon.spec.in.in	2008/03/19 20:10:47	1.18.2.33
+++ conga/clustermon.spec.in.in	2008/03/24 18:13:58	1.18.2.34
@@ -27,12 +27,23 @@
 Source0: %{name}-%{version}.tar.gz
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
-BuildRequires: cman-devel libvirt-devel
+%define virt_support 0
+
+%ifarch i386 x86_64 ia64
+%define virt_support 1
+%endif
+
+BuildRequires: cman-devel
 BuildRequires: glibc-devel gcc-c++ libxml2-devel
 BuildRequires: openssl-devel dbus-devel pam-devel pkgconfig
 BuildRequires: net-snmp-devel tog-pegasus-devel
 
-Requires: libvirt libxml2
+%if %{virt_support}
+BuildRequires: libvirt-devel
+Requires: libvirt
+%endif 
+
+Requires: libxml2
 
 %description
 This package contains Red Hat Enterprise Linux Cluster Suite
@@ -43,10 +54,18 @@
 %setup -q
 
 %build
+%if %{virt_support}
 %configure		--arch=%{_arch} \
 		--docdir=%{_docdir} \
 		--pegasus_providers_dir=%{PEGASUS_PROVIDERS_DIR} \
-		--include_zope_and_plone=no
+		--include_zope_and_plone=no --VIRT_SUPPORT=1
+%else
+%configure		--arch=%{_arch} \
+		--docdir=%{_docdir} \
+		--pegasus_providers_dir=%{PEGASUS_PROVIDERS_DIR} \
+		--include_zope_and_plone=no --VIRT_SUPPORT=0
+%endif
+
 make %{?_smp_mflags} clustermon
 
 %install
--- conga/ricci/modules/cluster/Makefile	2008/03/19 14:45:33	1.14.2.5
+++ conga/ricci/modules/cluster/Makefile	2008/03/24 18:13:58	1.14.2.6
@@ -26,8 +26,11 @@
 
 PARANOID=0
 INCLUDE += -I${top_srcdir}/common/
-CXXFLAGS += -DPARANOIA=$(PARANOID)
-LDFLAGS += -lvirt
+CXXFLAGS += -DPARANOIA=$(PARANOID) -DVIRT_SUPPORT=$(VIRT_SUPPORT)
+
+ifeq ($(VIRT_SUPPORT), 1)
+	LDFLAGS += -lvirt
+endif
 
 ifeq ($(PARANOID), 1)
 	LDFLAGS += ${top_srcdir}/common/paranoid/*.o
--- conga/ricci/modules/cluster/Virt.cpp	2008/03/19 14:45:33	1.1.2.4
+++ conga/ricci/modules/cluster/Virt.cpp	2008/03/24 18:13:58	1.1.2.5
@@ -23,7 +23,9 @@
 	#include <sys/stat.h>
 	#include <string.h>
 	#include <errno.h>
-	#include <libvirt/libvirt.h>
+	#if VIRT_SUPPORT == 1
+	#	include <libvirt/libvirt.h>
+	#endif
 
 	#include "sys_util.h"
 	#include "base64.h"
@@ -178,6 +180,7 @@
 	return (key_out);
 }
 
+#if VIRT_SUPPORT == 1
 map<String, String> Virt::get_vm_list(const String &hvURI) {
 	std::map<String, String> vm_list;
 	int i;
@@ -255,3 +258,10 @@
 	virConnectClose(con);
 	return vm_list;
 }
+#else
+map<String, String> Virt::get_vm_list(const String &hvURI) {
+	std::map<String, String> vm_list;
+	throw String("Not implemented on this architecture");
+	return vm_list;
+}
+#endif



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Cluster-devel] conga ./clustermon.spec.in.in ricci/modules/cl ...
@ 2008-03-31 17:23 rmccabe
  0 siblings, 0 replies; 5+ messages in thread
From: rmccabe @ 2008-03-31 17:23 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL5
Changes by:	rmccabe at sourceware.org	2008-03-31 17:23:45

Modified files:
	.              : clustermon.spec.in.in 
	ricci/modules/cluster: Virt.cpp 

Log message:
	Jerk the vm_list feature for the time being

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/clustermon.spec.in.in.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.18.2.35&r2=1.18.2.36
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/Virt.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.5&r2=1.1.2.6

--- conga/clustermon.spec.in.in	2008/03/28 01:15:16	1.18.2.35
+++ conga/clustermon.spec.in.in	2008/03/31 17:23:45	1.18.2.36
@@ -30,7 +30,7 @@
 %define virt_support 0
 
 %ifarch i386 x86_64 ia64
-%define virt_support 1
+%define virt_support 0
 %endif
 
 BuildRequires: cman-devel
@@ -40,7 +40,8 @@
 
 %if %{virt_support}
 BuildRequires: libvirt-devel
-%endif 
+Requires: libvirt
+%endif
 
 %description
 This package contains Red Hat Enterprise Linux Cluster Suite
@@ -55,7 +56,7 @@
 %configure		--arch=%{_arch} \
 		--docdir=%{_docdir} \
 		--pegasus_providers_dir=%{PEGASUS_PROVIDERS_DIR} \
-		--include_zope_and_plone=no --VIRT_SUPPORT=1
+		--include_zope_and_plone=no --VIRT_SUPPORT=0
 %else
 %configure		--arch=%{_arch} \
 		--docdir=%{_docdir} \
@@ -313,5 +314,5 @@
 - Don't auto-start modclusterd after installation, do it manually
 
 * Wed Aug 09 2006 Stanko Kupcevic <kupcevic@redhat.com> 0.8-11
-- Spinoff: separate clustermon.srpm (modcluster, cluster-snmp and 
+- Spinoff: separate clustermon.srpm (modcluster, cluster-snmp and
   cluster-cim) from conga.srpm
--- conga/ricci/modules/cluster/Virt.cpp	2008/03/24 18:13:58	1.1.2.5
+++ conga/ricci/modules/cluster/Virt.cpp	2008/03/31 17:23:45	1.1.2.6
@@ -261,7 +261,7 @@
 #else
 map<String, String> Virt::get_vm_list(const String &hvURI) {
 	std::map<String, String> vm_list;
-	throw String("Not implemented on this architecture");
+	throw String("Not implemented currently.");
 	return vm_list;
 }
 #endif



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-03-31 17:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-13 19:14 [Cluster-devel] conga ./clustermon.spec.in.in ricci/modules/cl kupcevic
  -- strict thread matches above, loose matches on Subject: below --
2007-10-09 19:58 rmccabe
2007-11-02  5:44 rmccabe
2008-03-24 18:13 rmccabe
2008-03-31 17:23 rmccabe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).