Well, I would think the time command would work? It should also exit 
status the same as the command that you run, though it is possible you'd 
miss out on some info such as:
Received 1 DHCPOFFER(s), 1 of 1 requested servers responded, max lease 
time = 86400 sec.

You'd still get a successful status, or a failure, but time would be 
given ... Other question of course is what to do if it times out - do 
you want that timeout entered, or something else in your time graphing?

If you want more control, you could probably use
#!/bin/bash
start=`date +%s`
output=`check_dhcp`
status=`echo $?`
end=`date +%s`
t=$((end-start))
echo $output "|time=" $t
exit $status

This is pretty hacky and may have incorrect syntax, but it's the basic 
Idea I think...
--
James Pulver
Information Technology Area Supervisor
LEPP Computer Group
Cornell University



kingpin wrote, On 5/14/2009 10:44 AM:
> Hi James, Thanks for the reply.
> 
> If succesfull : 
> OK: Received 1 DHCPOFFER(s), 1 of 1 requested servers responded, max lease 
> time = 86400 sec.
> If failed : 
> CRITICAL: No DHCPOFFERs were received.
> 
> I'm not sure how to do this. Should a create a command that triggers a bash 
> script and put the check_dhcp command in the bash script.  I have made simple 
> scripts in the past that present data to the nagios parser in zenoss to store 
> the result in a datapoint. 
> 
> But how can I best capture how long it takes for the DHCP offer/OK to arrive
> 
> 
> 
> 
> -------------------- m2f --------------------
> 
> Read this topic online here:
> http://forums.zenoss.com/viewtopic.php?p=34783#34783
> 
> -------------------- m2f --------------------
> 
> 
> 
> _______________________________________________
> zenoss-users mailing list
> [email protected]
> http://lists.zenoss.org/mailman/listinfo/zenoss-users
_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users

Reply via email to