Code: Select all
[root@server rra]# /home/www/cacti/scripts/esxiograph.sh cpu_vs XX.XX.XX.XX cacti "password"
usage:5.20
Code: Select all
<path_cacti>/scripts/esxiograph.sh <command> <ip> <vmname> <username> <password>
Moderators: Developers, Moderators
Code: Select all
[root@server rra]# /home/www/cacti/scripts/esxiograph.sh cpu_vs XX.XX.XX.XX cacti "password"
usage:5.20
Code: Select all
<path_cacti>/scripts/esxiograph.sh <command> <ip> <vmname> <username> <password>
Hi csexton127, what does the RRD tool error checking say? that fact that you are actually getting a graph is a good start. What are the permissions like on the file / folder where the script is located? Try making it 777 to make sure its not a permissions issues.csexton127 wrote:Has anyone else had an issue where cacti isn't adding the data to the rrd? I have set up the scripts according to Lee's post (great job, you're a life saver), and I'm able to get the data returned using the scripts:I did an import of the cacti template provided, changed the data input method to point to the script location:Code: Select all
[root@server rra]# /home/www/cacti/scripts/esxiograph.sh cpu_vs XX.XX.XX.XX cacti "password" usage:5.20
After adding a device/datasources/graphs, and letting the poller run a few times, I noticed that the graphs were not getting created. When I check the rrd file for the datasource, I notice that all of the values in it are NaN's. This is for all of the scripts vs or vm, so it's something I'm missing on my cacti side. Has anyone seen/fixed an issue like that? I'm using cacti 0.8.7g.Code: Select all
<path_cacti>/scripts/esxiograph.sh <command> <ip> <vmname> <username> <password>
Hey Lee, thanks for the reply. It ended up being a permissions issue with the cacti user and perl. The cacti user didn't have permissions to the perl libraries and modules so would fail when trying to run the scripts. I thought it was running correctly because I was testing the scripts as root.Hi csexton127, what does the RRD tool error checking say? that fact that you are actually getting a graph is a good start. What are the permissions like on the file / folder where the script is located? Try making it 777 to make sure its not a permissions issues.
Lee
Code: Select all
[cacti@server scripts]$ perl check_esx3.pl -H X.X.X.X -u cacti -p "password" -l NET
CHECK_ESX3.PL OK - net receive=0.00 KB/s, send=0.00 KB/s, all 3 NICs are connected | net_receive=0.00KB;; net_send=0.00KB;; OK_NICs=3;; Bad_NICs=0;;
[cacti@server scripts]$ perl check_esx3.pl -H X.X.X.X -u cacti -p "password" -l NET -s USAGE
CHECK_ESX3.PL OK - net usage=302.29 KB/s | net_usage=302.29KB;;
[cacti@server scripts]$ perl check_esx3.pl -H X.X.X.X -u cacti -p "password" -l NET -s RECEIVE
CHECK_ESX3.PL OK - net receive=0.00 KB/s | net_receive=0.00KB;;
[cacti@server scripts]$ perl check_esx3.pl -H X.X.X.X -u cacti -p "password" -l NET -s SEND
CHECK_ESX3.PL OK - net send=0.00 KB/s | net_send=0.00KB;;
Code: Select all
$values = return_host_performance_values($host, 'net', ('received.average:*'));
Code: Select all
$values = return_host_performance_values($host, 'net', (received.average:vmnic0'));
VMWare deploys with self-signed ssl certs, and you're running perl modules that are recent enough that they'll view a self-signed cert as a fatal error.ironique wrote:Have followed your guide, but when I test the check_esx3.pl to see if it returns anything, I get the following:
CHECK_ESX3.PL CRITICAL - Server version unavailable at 'https://<vCenter-IP>:443/sdk/vimService.wsdl' at /usr/share/perl/5.10/VMware/VICommon.pm line 545
Code: Select all
$ENV{SSL_verify_mode} = 0x00;
What about http://docs.cacti.net/plugin:discovery? Maybe we could ask cigamit to provide a function like "addDiscoveredDevice()" and "removeDiscoveredDevice()" for this? Would be useful for other plugins monitoring virtualized environments, too.ldjones48 wrote:each time you add a vm you need to add this in the cacti GUI. Thus if you removed one you would need to remove it. The reason being is it creates it own data collector per Virtual Machine not host.
I havn't used the Perl SDK yet but I have been playing around with the web services API. Have a look at http://www.vmware.com/support/developer ... nager.html and especially at the performance counters documentations under "Performance Counters".ldjones48 wrote:Not to sure on this to be honest, I know you can for each VM.dmanchanda wrote:My graphs for VMs are working fine, but i want to get graphs for DISC IOs, Read, Write latencies from the LUNs attached to the hypervisor (HOST). any idea on this.
csexton127 wrote:Hey Lee, thanks for the reply. It ended up being a permissions issue with the cacti user and perl. The cacti user didn't have permissions to the perl libraries and modules so would fail when trying to run the scripts. I thought it was running correctly because I was testing the scripts as root.Hi csexton127, what does the RRD tool error checking say? that fact that you are actually getting a graph is a good start. What are the permissions like on the file / folder where the script is located? Try making it 777 to make sure its not a permissions issues.
Lee
Another issue I seem to be having is that the SDK doesn't seem to want to return any network statistics if there are multiple active NIC's. I know the VM is receiving traffic because of the guest servers show traffic statistics. I'm polling the guest servers through the VCenter server and the VM host server directly.It seems to work as intended when I pull data from a VMWare server that only has 1 NIC. From what I can tell, this may be a problem with the SDK? I am using version 4.1.0-254719 of the SDK and ESX 4.0.0.Code: Select all
[cacti@server scripts]$ perl check_esx3.pl -H X.X.X.X -u cacti -p "password" -l NET CHECK_ESX3.PL OK - net receive=0.00 KB/s, send=0.00 KB/s, all 3 NICs are connected | net_receive=0.00KB;; net_send=0.00KB;; OK_NICs=3;; Bad_NICs=0;; [cacti@server scripts]$ perl check_esx3.pl -H X.X.X.X -u cacti -p "password" -l NET -s USAGE CHECK_ESX3.PL OK - net usage=302.29 KB/s | net_usage=302.29KB;; [cacti@server scripts]$ perl check_esx3.pl -H X.X.X.X -u cacti -p "password" -l NET -s RECEIVE CHECK_ESX3.PL OK - net receive=0.00 KB/s | net_receive=0.00KB;; [cacti@server scripts]$ perl check_esx3.pl -H X.X.X.X -u cacti -p "password" -l NET -s SEND CHECK_ESX3.PL OK - net send=0.00 KB/s | net_send=0.00KB;;
EDIT: It seems that with my version the lines calling the host performance values did not like the wildcard for the interface:Once I hardcoded the interface name into the script I was getting correct data back. In our environment we only have 1 NIC that was used, and the other 2 were for backup purposes only. While not an elegant solution, it does solve my immediate problem with the network statistics until we have to fail over. This fix would not work if you have traffic flowing on multiple NIC's. This may only be an issue with ESX 4 or a newer version of the SDK, and I will try and find a better solution. Here is an example of what I changed.Code: Select all
$values = return_host_performance_values($host, 'net', ('received.average:*'));
Code: Select all
$values = return_host_performance_values($host, 'net', (received.average:vmnic0'));
Code: Select all
perl /usr/share/cacti/site/scripts/check_esx3.pl -H <server-ip> -N <vm> -u <user> -p “<pass>” -l NET
Can't locate Nagios/Plugin.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at /usr/share/cacti/site/scripts/check_esx3.pl line 31.
BEGIN failed--compilation aborted at /usr/share/cacti/site/scripts/check_esx3.pl line 31.
I would like to know from feolener which modules in particular he had to upgrade to get the script running....feolener
I've got it.
The CPAN modules debian provides are a bit older than the once that are required and the ones that are required wouldn't install using CPAN.
I needed to manually make the CPAN modules. Now I do get output from the scripts..
Only IO gives all zero values. CPU and MEM for example work great
Code: Select all
[root@gw2 /usr/local/share/cacti/scripts]# ./check_esx3.pl -H 192.168.0.254 -l mem -s usage -f test
CHECK_ESX3.PL CRITICAL - Server version unavailable at 'https://192.168.0.254:443/sdk/vimService.wsdl' at /usr/local/lib/perl5/site_perl/5.14.1/VMware/VICommon.pm line 545, <AUTH_FILE> line 2.
[root@gw2 /usr/local/share/cacti/scripts]# ./check_esx3.pl -H 192.168.0.254 -l mem -s usage -u root -p 'mypasswordhere'
CHECK_ESX3.PL CRITICAL - Server version unavailable at 'https://192.168.0.254:443/sdk/vimService.wsdl' at /usr/local/lib/perl5/site_perl/5.14.1/VMware/VICommon.pm line 545.
Code: Select all
$ENV{SSL_verify_mode} = 0x00;
Code: Select all
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;
Users browsing this forum: No registered users and 2 guests