OpenVZ Forum - RDF feed
type: channel
items: SNMP monitoring of OpenVZ clusters
items: Re: SNMP monitoring of OpenVZ clusters

SNMP monitoring of OpenVZ clusters
type: item
description: Hi, we want to build a high availability cluster based on Redhat Cluster Suite and OpenVZ. The host systems are monitored by Zenoss using SNMP. The problem is that SNMP "sees" all processes on a node, host AND guest. When there is for example a VE with an Apache currently running on host A, Zenoss learns that there is an Apache process on host A. If we switch the VE to host system B the monitoring complains because the apache process on host A seems gone... Is there any possibility to change the visibility of guest processes in the host system (via a /proc/ switch or a kernel config option for example)? Any other ideas? Thanks in advance :-)
creator: rapallo
date: 2009-02-27T13:46:41-00:00

Re: SNMP monitoring of OpenVZ clusters
type: item
description: Can you not disable the process checks for the hardware nodes, and then run snmpd inside each container to be monitored separately?
creator: tomp
date: 2009-03-02T19:22:52-00:00

Re: SNMP monitoring of OpenVZ clusters
type: item
description: Hmmm there are processes on the host that we would like to monitor ... like the cluster software itself...
creator: rapallo
date: 2009-03-03T15:38:39-00:00

Re: SNMP monitoring of OpenVZ clusters
type: item
description: We are having the same issue. Did you find anything on this subject?
creator: kiddbios
date: 2009-04-08T19:52:33-00:00

Re: SNMP monitoring of OpenVZ clusters
type: item
description: Unfortunately not yet
creator: rapallo
date: 2009-04-15T08:39:48-00:00

Re: SNMP monitoring of OpenVZ clusters
type: item
description: Hey, I am revamping this thread as I have this problem, too. I thought about a solution and invented a patch for the proc-module of the ucd-snmp-module of net-snmp. It basically checks if the compared proc has the same envID as the snmpd process (which is 0 for HN, and VEID for VE). Via this it is possible to differ between processes of the HN and VEs. In a VE it is does not make sense to use this, because you will not see any other VEs processes But anyway, it does no harm inside a VE... I would appreciate some comments and if this also works for you --- a/agent/mibgroup/ucd-snmp/proc.c 2008-06-05 23:11:53.000000000 +0200 +++ b/agent/mibgroup/ucd-snmp/proc.c 2010-07-01 02:33:29.066790818 +0200 @@ -439,14 +439,50 @@ DIR *dir; char cmdline[512], *tmpc; char state[64]; + char envIDstr[32], *tmpid; struct dirent *ent; #ifdef USE_PROC_CMDLINE int fd; #endif int len,plen=strlen(procname),total = 0; FILE *status; + + /* var to save the envID */ + int envID, actEnvID; + DEBUGMSGTL(("proc", "opendir /proc.\n")); if ((dir = opendir("/proc")) == NULL) return -1; + + /* get our envID out of the /proc/self/status */ + /* read /proc/self/status */ + if ((status = fopen("/proc/self/status", "r")) == NULL) { + DEBUGMSGTL(("proc", "Could not open /proc/self/status.\n")); + return -1; + } + /* read lines till we find the envID line */ + envIDstr[0] = '\0'; + while( strstr(envIDstr, "envID:") == NULL ) { + /*if unreadable or EOF, return an error (-1)*/ + if (fgets(envIDstr, sizeof(envIDstr), status) == NULL) { + fclose(status); + DEBUGMSGTL(("proc", "Could not skip lines until \"envID\" found - unreadable or no such line in status-file.\n")); + return -1; + } + } + fclose(status); + /* parse this line, get envID */ + envIDstr[sizeof(envIDstr)-1] = '\0'; + tmpid = skip_token(envIDstr); + if (!tmpid) + return -1; + for (len=0;; len++) { + if (tmpid[len] && isgraph(tmpid[len])) continue; + tmpid[len]='\0'; + break; + } + envID = atoi(tmpid); + DEBUGMSGTL(("proc", "SNMPD is using envID %…
creator: Poikilotherm
date: 2010-07-01T12:01:09-00:00