Windows WMI with Cacti on Linux server
Moderators: Developers, Moderators
Windows WMI with Cacti on Linux server
Hi,
has anyone graphed Windows 2000/2003 servers using WMI when Cacti is installed on a *nix (Linux/FreeBSD/whatever) server? All the examples I have seen so far has been for Cacti running on Windows using PHP/Visual Basic scripts which is no good on my Debian Linux.
I suck at coding so don't want to start putting it together myself unless as a last resort, so any scripts or help would be appreciated
has anyone graphed Windows 2000/2003 servers using WMI when Cacti is installed on a *nix (Linux/FreeBSD/whatever) server? All the examples I have seen so far has been for Cacti running on Windows using PHP/Visual Basic scripts which is no good on my Debian Linux.
I suck at coding so don't want to start putting it together myself unless as a last resort, so any scripts or help would be appreciated
-
- Posts: 31
- Joined: Fri Nov 22, 2002 10:50 am
- Location: Rochester, UK
This could be a solution, but there is no Win32::OLE perl module for Debian, and it borked when I tried to install it via CPAN.Scipio wrote:Hi
I think you can use the scripts writed for win2k. They are written in perl, so normally, it works perfeclty under linux. But you must be sure to have this library: Win32::OLE
Cause the scripts use this library the interact with the wmi.
Can somone confirm that ?
I would prefer perl modules installed via packages (apt) instead of CPAN installed modules to keep the system consistent.
So.. why don't you try with php ?
http://www.aspfree.com/c/a/Windows-Scri ... -with-PHP/
but, it's not an "easy way"...
http://www.aspfree.com/c/a/Windows-Scri ... -with-PHP/
but, it's not an "easy way"...
Tiago Coimbra
Gruyère Energie
Gruyère Energie
-
- Posts: 31
- Joined: Fri Nov 22, 2002 10:50 am
- Location: Rochester, UK
Taken from
http://www.talkaboutprogramming.com/gro ... 63667.html
I guess I will have to investigate the PHP option mentioned in the post above.
Regards,
Anthony
http://www.talkaboutprogramming.com/gro ... 63667.html
So it appears that you cannot compile Win32::OLE.Vinod. K wrote:
> Hi All,
>
> Pls help me in installing the module, Win32-OLE-0.17 in solaris 2.6
> server.
Can't be done. Win32::OLE can be built *only* on Win32 machines.
Cheers,
Rob
I guess I will have to investigate the PHP option mentioned in the post above.
Regards,
Anthony
NRPE
In order to monitor Windows servers from a linux box with WMI,
you should use NRPE_NT.
Perl scripts posted in this forum can be easily adapted :
Per exemple, on cacti :
Original "input string" was :
perl <path_cacti>/scripts/w32_query_LogicalDisk.pl <hostname> <driveletter>
New "input string" :
<path_cacti>/scripts/check_nrpe -H <nrpe_hostname> -c check_disk -a <hostname> <driveletter>
where <nrpe_hostname> is the windows server where nrpe_nt is installed.
In "nrpe_nt.cfg" file, add a line like this :
command[check_disk]=c:\perl\bin\perl.exe C:\nrpe\bin\w32_query_LogicalDisk.pl $ARG1$ get size,freespace $ARG2$
you should use NRPE_NT.
Perl scripts posted in this forum can be easily adapted :
Per exemple, on cacti :
Original "input string" was :
perl <path_cacti>/scripts/w32_query_LogicalDisk.pl <hostname> <driveletter>
New "input string" :
<path_cacti>/scripts/check_nrpe -H <nrpe_hostname> -c check_disk -a <hostname> <driveletter>
where <nrpe_hostname> is the windows server where nrpe_nt is installed.
In "nrpe_nt.cfg" file, add a line like this :
command[check_disk]=c:\perl\bin\perl.exe C:\nrpe\bin\w32_query_LogicalDisk.pl $ARG1$ get size,freespace $ARG2$
-
- Posts: 1
- Joined: Fri Nov 05, 2004 7:56 am
- Location: London
- kwabbernoot
- Cacti User
- Posts: 99
- Joined: Mon Oct 13, 2003 4:11 am
- Location: Zottegem, Belgium
Another possibility...
Hi,
At the company where I work we use the windows Nagios agent on the NT/2000/2003 boxes that we monitor.
see this post for more info http://forums.cacti.net/viewtopic.php?t=1041
The nagios agent has the advantage that you only need to create the script on you Cacti/*nix box. On your Windoze box you only have to make sure that the agent service runs and it is stable.
The second page of the post contains an active example of a graph using the nagios agent.
The agent can be downloaded from http://nsclient.ready2run.nl/download.htm
You need to install it on every server that you want to monitor.
Regards,
Kwabbernoot
At the company where I work we use the windows Nagios agent on the NT/2000/2003 boxes that we monitor.
see this post for more info http://forums.cacti.net/viewtopic.php?t=1041
The nagios agent has the advantage that you only need to create the script on you Cacti/*nix box. On your Windoze box you only have to make sure that the agent service runs and it is stable.
The second page of the post contains an active example of a graph using the nagios agent.
The agent can be downloaded from http://nsclient.ready2run.nl/download.htm
You need to install it on every server that you want to monitor.
Regards,
Kwabbernoot
You can olso install cacti on a Linux machine, NRPE_NT on 1 NT/W2K/W2K3/XP host and create template which interorage others hosts via
WMI
example:
check_wmi.pl on linux host
#!/usr/bin/perl
$response=`/var/www/cacti/scripts/check_nrpe -t 1000 -H hostnameofthenrpe_nthost -c $ARGV[0] -a $ARGV[1] $ARGV[2] $ARGV[3] $ARGV[4]`;
chomp $response;
print "$response\n";
example of commands in nrpe.cfg :
#check disk $ARG1$=hostname $ARG2$=letter
command[check_disk]=cscript //nologo //T:1000 C:\nrpe\bin\scripts\check_wmi_disk.vbs $ARG1$ $ARG2$
#check mem $ARG1$=hostname
command[check_mem]=cscript //nologo //T:1000 C:\nrpe\bin\scripts\check_wmi_mem.vbs $ARG1$
#check mem $ARG1$=hostname
command[check_cpu]=cscript //nologo //T:1000 C:\nrpe\bin\scripts\check_wmi_cpu.vbs $ARG1$
WMI
example:
check_wmi.pl on linux host
#!/usr/bin/perl
$response=`/var/www/cacti/scripts/check_nrpe -t 1000 -H hostnameofthenrpe_nthost -c $ARGV[0] -a $ARGV[1] $ARGV[2] $ARGV[3] $ARGV[4]`;
chomp $response;
print "$response\n";
example of commands in nrpe.cfg :
#check disk $ARG1$=hostname $ARG2$=letter
command[check_disk]=cscript //nologo //T:1000 C:\nrpe\bin\scripts\check_wmi_disk.vbs $ARG1$ $ARG2$
#check mem $ARG1$=hostname
command[check_mem]=cscript //nologo //T:1000 C:\nrpe\bin\scripts\check_wmi_mem.vbs $ARG1$
#check mem $ARG1$=hostname
command[check_cpu]=cscript //nologo //T:1000 C:\nrpe\bin\scripts\check_wmi_cpu.vbs $ARG1$
Who is online
Users browsing this forum: No registered users and 4 guests