Quantcast
Channel: VMware Communities : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 176483

Can run health check successfully from the CLI, but a cronjob fails with "Server version unavailable" ...

$
0
0

Hey guys,

 

I really tried to figure this out myself, but I'm at a wall.  I tried searching through the group but can't find a question that quite describes the problem I'm having.

 

What I'm trying to do is schedule the vSphereHealthCheck script to run once a day and e-mail me the results.  To do that I have installed the vMA on one of my ESX servers.  If I SSH into it and run the following command:

 

/home/vi-admin/vmwarevSphereHealthCheck/vmwarevSphereHealthCheck.pl --server 10.32.10.27 --username root --password ****** --type host --conf /home/vi-admin/vmwarevSphereHealthCheck/healthCheck.conf --email yes

 

Then I will see the familiar message about "getting a cup of coffee..." and eventually it finishes.  There is one small error I get back in the CLI:

 

Use of uninitialized value in concatenation (.) or string at /home/vi-admin/vmwarevSphereHealthCheck/vmwarevSphereHealthCheck.pl line 391.

That being said, this error doesn't appear to impact the script, as I receive the e-mail and all the content is complete in the report.
So now I want to schedule it to run every day and e-mail me the report.  I'm an admitted Linux newbie, but I know that typically this is done with a cronjob.  So I edit the cronjob with crontab -e and enter in the exact command I pasted above.  If I run crontab -l, this is what the output is:
vi-admin@localhost:~/vmwarevSphereHealthCheck> crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.XXXXSVA6rh installed on Fri Sep  7 10:09:42 2012)
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
PATH=/home/vi-admin/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/                                                           usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/java/jre-vmware/bin:/sbin:/usr/sbin:/opt/vmware/bin

 

54 15 * * * /home/vi-admin/vmwarevSphereHealthCheck/vmwarevSphereHealthCheck.pl --server 10.32.10.27 --username root --password ****** --type host --conf /home/vi-admin/vmwarevSphereHealthCheck/healthCheck.conf --email yes

Ignore the time.  I've just been editing the time over and over to be a few minutes in the future to check if the script will run successfully.  The path is specified because I googled around and read that the cron path and the user path are different, so I copied my user path into the cron job in hopes of making them the same.
So now if I wait for the job to run, it will run, and eventually I'll get the following mail message from the system:
From vi-admin@localhost.localdomain  Fri Sep  7 10:12:03 2012
Return-Path: <vi-admin@localhost.localdomain>
Received: from localhost.localdom (localhost.localdom [127.0.0.1])
        by localhost.localdom (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id q87AC1go026806
        for <vi-admin@localhost.localdom>; Fri, 7 Sep 2012 10:12:03 GMT
Received: (from vi-admin@localhost)
        by localhost.localdom (8.14.3/8.14.3/Submit) id q87AC1fr026805;
        Fri, 7 Sep 2012 10:12:01 GMT
Date: Fri, 7 Sep 2012 10:12:01 GMT
Message-Id: <201209071012.q87AC1fr026805@localhost.localdom>
From: vi-admin@localhost.localdomain
To: vi-admin@localhost.localdom
Subject: Cron <vi-admin@localhost> /home/vi-admin/vmwarevSphereHealthCheck/vmwarevSphereHealthCheck.pl --server 10.32.10.27 --username root --password ****** --type host --conf /home/vi-admin/vmwarevSphereHealthCheck/healthCheck.conf --email yes
X-Cron-Env: <PATH=/home/vi-admin/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/java/jre-vmware/bin:/sbin:/usr/sbin:/opt/vmware/bin>
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/home/vi-admin>
X-Cron-Env: <LOGNAME=vi-admin>
X-Cron-Env: <USER=vi-admin>


Server version unavailable at 'https://10.32.10.27:443/sdk/vimService.wsdl' at /usr/lib/perl5/5.10.0/VMware/VICommon.pm line 545.

 

And that's it.  I can't get past this.  Anyone that can offer any insight about this error would be my new hero.  Thanks very much!

 

Message was edited by: JonBlack.  Made it more readable


Viewing all articles
Browse latest Browse all 176483

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>