Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Windows uptime statistics
Goto page Previous  1, 2, 3, 4
 
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates
Author Message
arjanv



Joined: 09 Dec 2004
Posts: 13

PostPosted: Wed Jun 13, 2007 7:21 am    Post subject: Reply with quote

I wan't to monitor several Windows 2003 servers from my Centos Cacti server.

Is it possible te use this script on linux to poll Windows Servers?
Does anyone have a quick how-to?
Back to top
tspec



Joined: 15 Nov 2005
Posts: 8

PostPosted: Thu Jun 21, 2007 10:06 pm    Post subject: Reply with quote

arjanv wrote:
Is it possible te use this script on linux to poll Windows Servers?
Does anyone have a quick how-to?


Also after the same thing, would love to get uptime statics running on my install of cacti which is running on Ubuntu. If anyone can help, that would be fantastic. Running version 0.8.6h.

/edit: On my continued search, Hobbit Monitoring looks like it might be a goer as it plugs into cacti. Anyone had any experience with it.... good / not good ???

http://www.hobbitmon.com/
Back to top
ABX
Cacti User


Joined: 01 Mar 2007
Posts: 61

PostPosted: Thu Jul 12, 2007 3:53 am    Post subject: Reply with quote

When I run win_uptime.cmd from command prompt I get an error.

c:\>win_uptime.cmd loclhost 99.95
Couldn't get it! at d:\something\cacti\scripts\uptime\win_uptime.pl line 20.
sla_avail:99.95
Back to top
frostie



Joined: 24 Oct 2007
Posts: 1

PostPosted: Wed Oct 24, 2007 5:31 pm    Post subject: Linux Port Reply with quote

Hi is there a linux version for the uptime script?

The xml files import fine, just the scripts woun't run...

Thanks
Neil
Back to top
malibumaniac



Joined: 08 Apr 2008
Posts: 14

PostPosted: Thu Apr 10, 2008 5:29 am    Post subject: Reply with quote

ABX wrote:
When I run win_uptime.cmd from command prompt I get an error.

c:\>win_uptime.cmd loclhost 99.95
Couldn't get it! at d:\something\cacti\scripts\uptime\win_uptime.pl line 20.
sla_avail:99.95


same here..

someone got this solved?
i've checked line 20, its

my $content = LWP::Simple::get($httpaddr) or die "Couldn't get it!";

i have serious no clue how to fix..
Back to top
Brashquido
Cacti User


Joined: 28 Feb 2004
Posts: 99
Location: Melbourne, Australia

PostPosted: Sat Apr 12, 2008 6:55 pm    Post subject: Reply with quote

I'm the same on this one. From what I can gather the Perl script is trying access the web address specified in the win_uptime.cmd script.
Back to top
royce
Cacti User


Joined: 29 Dec 2004
Posts: 79
Location: Sweden

PostPosted: Tue Oct 14, 2008 7:08 am    Post subject: linux -> Windows WMI Reply with quote

hi.

You guys running Linux. Be sure to remove any ^M 's in the perl scripts supplied.

Code:

$ dos2unix win_cur_uptime.pl
$ dos2unix win_uptime.pl



Someone asked for my linux-script I use to get info. As I said before I use NRPe to connect to a Windows server and from there, to any windows server within that Active directory.

Please note. You have to configure the NRPE commands on the Windows server in order to do what you like.

Here's my script i use for that.

Code:
!/bin/sh

log="/cacti path/cacti/log/uptime_$1.log"
txt="/cacti path/cacti/log/uptime_$1.txt"
gawk=/usr/bin/gawk

htmlfile=/your cacti path here/cacti/log/uptime_$1.html
htmladdr=http://your cacti server here/cacti/log/uptime_$1.html
script_path=/your cacti path here/scripts/uptime

$gawk -f $script_path/gawk_head.txt $log > $htmlfile
echo "000000 Uptime Report for: \\\\$1" > $log

/your cacti path here/cacti/scripts/check_nrpe -H <NRPE windows server> -c win32_uptime1 -a "$1" > $txt

/your cacti path here/cacti/scripts/check_nrpe -H <NRPE windows server> -c win32_uptime2 -a "$1" | tr '@' '\n' >> $log

gawk -f $script_path/gawk_main.txt $log >> $htmlfile
gawk -f $script_path/gawk_tail.txt $log >> $htmlfile
perl $script_path/win_cur_uptime.pl $txt
perl $script_path/win_uptime.pl $htmladdr
echo sla_avail:$2

rm $log
rm $txt
rm $htmlfile


So. The flow goes like this:

Cacti server (Linux)
Windows NRPE (Windows)
Other Windows servers (AD)


Linux runs the script configured (above) wich runs check_nrpe. Check_nrpe sends "win32_uptime1" to my Windows server, it also includes the IP address of the AD server cacti wants to poll. Then check_nrpe runs the windows script at the windows server and collects the WMI data from the AD server, and returns the output to Cacti.

Next, I use a quick and dirty solution to fix the buffered-output problem. I run the win_update.sh through a script that just echo's all output up front. (Because cactid/php want it that way..) anyway. Dirty dirty.

Code:
#!/bin/sh
E=`/usr/share/cacti/scripts/uptime/win_uptime.sh $1 $2`

echo $E


Hope this helps someone.
Back to top
Hyperion.Jiang



Joined: 11 Nov 2008
Posts: 1

PostPosted: Tue Nov 11, 2008 2:12 am    Post subject: Re: Windows uptime statistics Reply with quote

hello !
thanks for you supporting the Templates for windows uptime , but I can't catch the data , when I import it sucessfully , so I want to make sure weather it's suitable for cacti from linux or not ?

PS : my cacti set on linux , not windows platform , tks !
Back to top
royce
Cacti User


Joined: 29 Dec 2004
Posts: 79
Location: Sweden

PostPosted: Tue Nov 11, 2008 2:58 am    Post subject: Re: Windows uptime statistics Reply with quote

Hyperion.Jiang wrote:
hello !
thanks for you supporting the Templates for windows uptime , but I can't catch the data , when I import it sucessfully , so I want to make sure weather it's suitable for cacti from linux or not ?

PS : my cacti set on linux , not windows platform , tks !


Hi.
If you are used to Linux, you are used to find ways to get your stuff running. Linux is like UNIX, and UNIX teaches one to read and understand.

My previous post was written to folks that runs linux and knows how to read and understand a simple shell script and instructions. What you do with it is up to you. If you feel this is to less plug and play, don't bother.

Thanks
Chris
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates All times are GMT - 5 Hours
Goto page Previous  1, 2, 3, 4
Page 4 of 4

 



Powered by phpBB © 2001, 2005 phpBB Group