This script looks fantastic.  Thank you!

I took it and tried to bend it to my will and am having some problems.
I wonder if it is because of my bending or if I am just missing
something.

I wanted to see
NumberOfMessages from Exchange_Queue WHERE
QueueName=back_end_exchange_server

When I run just that query (using the line in your script minus the
parens and RAW=$) I get 3 messages:

ERROR: dcom_create_object.
ERROR: Login to remote object.
NTSTATUS: NT_STATUS_NO_MEMORY - Memory allocation error

I understand that I may have a problem elseware and I am looking into
that but, can you tell me if I need to have any 3rd party tools target
machine to read this data?
I checked the username and password and tried it with and without the
domain I get the same result. 

Being able to monitor the above query in Zenoss would be a HUGE help to
us so I am really hoping someone can point me in the right direction.

Thanks;
James

James Alspach
Systems Applications Technician
Shasta County Office of Education

> Message: 2
> Date: Wed, 07 Nov 2007 05:45:14 +0000
> From: "tseward" <[EMAIL PROTECTED]>
> Subject: [zenoss-users] Script: Retreiving number of items from an
>       Exchange        mailbox
> To: [email protected]
> Message-ID: <[EMAIL PROTECTED]>
> 
> Based on the WMI ZenPack...
> 
> myscript.sh:
> 
> 
> Code:
> 
> #!/bin/sh
> 
> RAW=$(wmic --namespace='root\MicrosoftExchangeV2' -U $1%$2
> //exchange.server.com "SELECT TotalItems FROM Exchange_Mailbox WHERE
> MailboxDisplayName='mymailbox'")
> 
> ERROR=`echo $RAW | cut -f2- -d\ | tr ' ' '\n' | grep 'ERROR' | cut -f1
-d:
> | head -1`
> 
> if [ "$ERROR" != "ERROR" ]
> then
> RESULT=`echo $RAW | cut -d \|  -f 11`
> RESULT=`echo $RESULT | cut -d \|  -f 1`
> echo -n $RESULT | awk '{print "OK|Items=" $1}'
> else
> echo -n $RAW | awk '{print $RAW}'
> fi
> 
> 
> 
> 
> The Data Source COMMAND should look like:
> 
> 
> Code:
> 
> $$ZENHOME/libexec/myscript.sh '${dev/zWinUser}' '${dev/zWinPassword}'
> 
> 
> 
> 
> There should be a DataPoint named "Items" with an ABSOLUTE type.
> 
> Create your threshold/graph accordingly.  Tested against Exchange 2003
> SP2.
> 
> 
> 

_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users

Reply via email to