Subject: Help with Prog Service

From: <[email-masked]>
Date: Thu, 24 Feb 2011 12:13:02 -0500

Hi,

I need to monitor a ZPOOL status on a Solaris system using Prog Service
where I can issue a ssh command such as:

"ssh <hostname> zpool status -xv" 

and the result should be "all pools are healthy". If its any otherwise
or output contain any error on the Zpool, service should go red and
alarm should trigger. I'm just not sure how to implement this using Prog
Service. I mean how to use Pluck and/or Expect or what else. Could you
please provide a sample of the code how would this be achieved? Thanks
in advance.

-Chirag.

---

From: Jeremy Kister <[email-masked]>
Date: Thu, 24 Feb 2011 23:12:34 -0500

> where I can issue a ssh command such as:

I solved this by installing the included argus-agent on the machine with 
the zfs.

# copy the argus-agent from the argus host
scp <argus_host>:/usr/local/sbin/argus-agent /usr/local/sbin

# set up the argus-agent in /etc/services
echo -e "argus-agent\t164/tcp" >> /etc/services

# set up the argus-agent in inetd.conf
echo -e 
"argus-agent\tstream\ttcp\tnowait\troot\t/usr/local/sbin/argus-agent\targus-agent" 
 >> /etc/inetd.conf
pkill -HUP inetd

# if the host is solaris 10, run:
inetconv

# verify it's accepting sockets on port 164 (you telnet and type "zpool 
<poolname>)
telnet localhost 164
Trying localhost...
Connected to localhost.
Escape character is '^]'.
zpool rpool
ONLINE
Connection to localhost closed by foreign host.

once you get this far, you just go to your argus config, and something like:

Group "machine" {
      Service Ping
      Service Agent/zpool {
          arg: pool_name
          expect: ONLINE
      }
}

make sure any packet filters you might have set up between the two hosts 
allow port 164/tcp.

that should get you all set.

-- 

Jeremy Kister
http://jeremy.kister.net./

---

From: <[email-masked]>
Date: Fri, 25 Feb 2011 14:55:22 -0500

Jeremy,
Thanks for the update. Though there are 2 points to note here...

1) In our environment, we could not and did not want to use argus-agent
on target system which is being monitored.
2) In this particular case, alarm would only trigger if a particular
zpool is not in 'ONLINE' state. Rather we wanted alarm to be triggered
even if pool contains any data errors and still ONLINE.

To solve these, I used below approach with Prog service which seems to
work nicely since now I get alarms if my pool contains any data errors
despite it being ONLINE and in turn I can run 'zpool clear <poolname>'
on target system to clear any data errors and alarm would reset (turn
back to green). Do note that ssh keys need to be set so that ssh command
in below service works without any password prompts. In this case argus
host's public ssh-key need to be appended in client/target host's
~/.ssh/authorized_keys2 file so ssh to the host works without any
prompts.

...just another way of handling this...

Service Prog {
	command:	ssh <host> zpool status -xv iscsipool
	drawgrid:	yes
	expect:	healthy
	graph:	yes
	label:	iscsipool Status
	messagedn:	pool 'iscsipool' contains errors
	messageup:	pool 'iscsipool' has been cleared of errors and
now healthy
	title:	iscsipool Health Status
	uname:	iscsipool Status
}

Thanks for your help though. Much appreciated. Its nice to know
different options to handle this type of situation. :) Thanks again.

-Chirag.

-----Original Message-----
From: [email-masked] [mailto:[email-masked]]
On Behalf Of Jeremy Kister
Sent: Thursday, February 24, 2011 11:13 PM
To: Discussion about Argus
Subject: Re: Help with Prog Service

the zfs.

# set up the argus-agent in inetd.conf
echo -e 
"argus-agent\tstream\ttcp\tnowait\troot\t/usr/local/sbin/argus-agent\tar
gus-agent" 
pkill -HUP inetd

once you get this far, you just go to your argus config, and something
like:

Group "machine" {
      Service Ping
      Service Agent/zpool {
          arg: pool_name
          expect: ONLINE
      }
}

allow port 164/tcp.

-- 

Jeremy Kister

_______________________________________________
http://argus.tcp4me.com/
[email-masked]
http://www.tcp4me.com/mailman/listinfo/arguslist