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  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates
Author Message
royce
Cacti User


Joined: 29 Dec 2004
Posts: 79
Location: Sweden

PostPosted: Wed Nov 23, 2005 7:17 am    Post subject: Reply with quote

Here is what happens ...

Code:
11/23/2005 11:50:17 AM - CACTID: Poller[0] Host[297] DS[21064] SCRIPT: \path\win_uptime.cmd hostname 99.9900, output: cur_uptime:2906263
11/23/2005 11:50:17 AM - CACTID: Poller[0] DEBUG: SQLCMD: insert into poller_output (local_data_id,rrd_name,time,output) values (210
64,'','2005-11-23 11:50:01','cur_uptime:2906263')
11/23/2005 11:50:17 AM - CACTID: Poller[0] Host[297] DEBUG: The POPEN returned the following File Descriptor 9


Something seems to be wrong with the way it sends data.
Back to top
wvr120364



Joined: 06 May 2003
Posts: 16

PostPosted: Wed Nov 23, 2005 7:24 am    Post subject: Reply with quote

royce wrote:
I've got the same problem - debugging cacti tells that cacti only sees some of the output vars...

Do the maintainer use cactid och php?


royce,

I'm using the php poller, maybe that is the problem. I tried earlier to use the cactid poller but suddenly there is no data collection at all.

Is there anybody were the scripts are working fine?

Wietze
Back to top
royce
Cacti User


Joined: 29 Dec 2004
Posts: 79
Location: Sweden

PostPosted: Wed Nov 23, 2005 7:32 am    Post subject: Reply with quote

fixed this.. seems to be another buffer-ouput-problem.

Bound my scripts through a executer-wrapper wich is a basic script that outputs the information in one buffer.

A shell script might look like this one - not that I've converted this to linux instead.

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

echo $E
exit 0
Back to top
proohu01



Joined: 20 Dec 2004
Posts: 25
Location: The Netherlands

PostPosted: Wed Nov 23, 2005 7:48 am    Post subject: same here Reply with quote

royce wrote:
chewy009 wrote:
OK, so i installed this on my "production" cacti box and it seems like it's working. Why is the Required (SLA) showing up as 0.0000%? Will the rest of the graph items fill in over time or should they already be there? I rebooted this box yesterday, hence the 0.98 days of uptime. What do you think?


I've got the same problem - debugging cacti tells that cacti only sees some of the output vars...

Do the maintainer use cactid och php?


Same problem here.

When I run the CMD from the command prompt, I do get good results. All values are returned. But when cacti does it, it only shows "uptime since last reboot" in the graph.

Any ideas?
Back to top
xphu



Joined: 30 Jun 2005
Posts: 12
Location: Helsinki, Finland

PostPosted: Wed Nov 23, 2005 7:58 am    Post subject: Reply with quote

Hi,

I got your nice uptime script working only locally in my Windows 2003 std Server where I am also runnig cacti.

I was not able to get it working with other Devices i.e. Windows Servers which are graphing with cacti.

Please see how the win_uptime.cmd is showing it up.

First with localhost which is working (returns good result) and after even a local host ip 127.0.0.1 does not return a correct result?

C:\Inetpub\wwwroot\scripts\uptime>win_uptime.cmd localhost 99.95
cur_uptime:3569 mean_days:1.59 tot_uptime:5856027 tot_blue:0 tot_downtime:194810
tot_reb:44 avail:96.7804 sla_avail:99.95

C:\Inetpub\wwwroot\scripts\uptime>win_uptime.cmd localhost 99.95
cur_uptime:3570 mean_days:1.59 tot_uptime:5856029 tot_blue:0 tot_downtime:194810
tot_reb:44 avail:96.7804 sla_avail:99.95

C:\Inetpub\wwwroot\scripts\uptime>win_uptime.cmd 172.16.10.251 99.95
tot_blue:1 tot_reb:1 sla_avail:99.95

C:\Inetpub\wwwroot\scripts\uptime>win_uptime.cmd 172.0.0.1 99.95
tot_blue:1 tot_reb:1 sla_avail:99.95

C:\Inetpub\wwwroot\scripts\uptime>

With not working graph I see tot-blue:1 tot-reb:1 sla-avail:99.95 nothing else?

What can be the problem. I cannot use fully qualified domain names for http url? I am not connecting to my cacti server form internet at all.

\xphu
Back to top
royce
Cacti User


Joined: 29 Dec 2004
Posts: 79
Location: Sweden

PostPosted: Wed Nov 23, 2005 8:25 am    Post subject: Reply with quote

wvr120364 wrote:
royce wrote:
I've got the same problem - debugging cacti tells that cacti only sees some of the output vars...

Do the maintainer use cactid och php?


royce,

I'm using the php poller, maybe that is the problem. I tried earlier to use the cactid poller but suddenly there is no data collection at all.

Is there anybody were the scripts are working fine?

Wietze



Script works with cacti here now. Solution was to create that wrapper script and use that instead. read my erlier porst.

I use cactid.
Back to top
proohu01



Joined: 20 Dec 2004
Posts: 25
Location: The Netherlands

PostPosted: Wed Nov 23, 2005 8:40 am    Post subject: RE: royce Reply with quote

I see youre post on the wrapper but I don't get it. How does this work on a windows server?

Should this wrapper replace any files? Could you explain how this helps?
Back to top
royce
Cacti User


Joined: 29 Dec 2004
Posts: 79
Location: Sweden

PostPosted: Wed Nov 23, 2005 9:22 am    Post subject: Re: RE: royce Reply with quote

proohu01 wrote:
I see youre post on the wrapper but I don't get it. How does this work on a windows server?

Should this wrapper replace any files? Could you explain how this helps?


The reason cacti does'nt read all input fields from the script (win_uptime.cmd) is that, AFAIK, the output is buffered in sections instead of a whole string.

So my solution was tell cacti call another script which basically call the original script and echo the output at one time.
Back to top
xphu



Joined: 30 Jun 2005
Posts: 12
Location: Helsinki, Finland

PostPosted: Wed Nov 23, 2005 9:42 am    Post subject: uptime.exe Reply with quote

Hi,

I think I found the solution for my earlier post.

http://support.microsoft.com/kb/q232243/

So I need to set up correct user privileges for my cacti network.

\xphu
Back to top
proohu01



Joined: 20 Dec 2004
Posts: 25
Location: The Netherlands

PostPosted: Wed Nov 23, 2005 12:41 pm    Post subject: It is working.... Reply with quote

It's working now.

The only thing I did was to change the poller from cactid to cmd.php. Somehow the CMD.PHP works better for this script.



graph_image.png
 Description:
 Filesize:  43.78 KB
 Viewed:  7295 Time(s)

graph_image.png


Back to top
chewy009



Joined: 15 Jun 2005
Posts: 37
Location: Washington State, USA

PostPosted: Tue Nov 29, 2005 11:11 am    Post subject: Re: RE: royce Reply with quote

royce wrote:
proohu01 wrote:
I see youre post on the wrapper but I don't get it. How does this work on a windows server?

Should this wrapper replace any files? Could you explain how this helps?


The reason cacti does'nt read all input fields from the script (win_uptime.cmd) is that, AFAIK, the output is buffered in sections instead of a whole string.

So my solution was tell cacti call another script which basically call the original script and echo the output at one time.


Royce,
Not to be completely dumb here, but can give me a step-by-step on what you did. I don't fully understand what you mean here. Is there a file you can post? I have to use cactid due to the number of graphs I have. Thx.
Back to top
magoo95



Joined: 15 Nov 2005
Posts: 18
Location: Paris, FRANCE

PostPosted: Thu Dec 01, 2005 8:44 am    Post subject: Reply with quote

This is the script you can use under windows to call the original win_uptime.cmd script.

this new script must be declared in the "data input method" in place of win_uptime:

@echo off
set templog=C:\bvra\cacti\scripts\uptime\tempo_%1.log
call C:/bvra/cacti/scripts/uptime/win_uptime.cmd %1 %2 > %templog%
type %templog%
del C:\bvra\cacti\scripts\uptime\tempo_%1.log

and it works fine now:



uptimewin.JPG
 Description:
 Filesize:  61.26 KB
 Viewed:  7210 Time(s)

uptimewin.JPG


Back to top
fishgod



Joined: 30 Nov 2005
Posts: 8
Location: Anchorage, Alaska

PostPosted: Thu Dec 01, 2005 1:40 pm    Post subject: Reply with quote

I am having permission issues. If I run the script as a domain admin I get data. If I let system run it from the cacti poller I get no data. One of the notes on the install for win2003 was to not use a domain account becauce of issues. They suggest using the local system account. Anyone have any ideas on which direction I should go.

Michael
Back to top
proohu01



Joined: 20 Dec 2004
Posts: 25
Location: The Netherlands

PostPosted: Fri Dec 02, 2005 10:30 am    Post subject: This might help... Reply with quote

I used a domain account and placed that account into the local administrators group on the remote servers. That way the account should have the right permissions to query WMI from a remote host.

Use that domain account to schedule the poller. The problem you may see with that is that the poller pops up many time when logged on to the cacti server with that same account. I suggest you us an account that you would not normally use when you logon to the server.
Back to top
BSOD2600
Cacti Moderator


Joined: 08 May 2004
Posts: 6793
Location: WA, USA

PostPosted: Fri Dec 02, 2005 1:04 pm    Post subject: Reply with quote

If you read my faq, I recently created one on how to properly set up WMI so a normal user can query a remote computer.
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  Next
Page 2 of 4

 



Powered by phpBB © 2001, 2005 phpBB Group