473,699 Members | 2,741 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

uptime script for openbsd

hello..
could anyone please help me build a uptime script for openbsd?
i tried phpsysinfo, it doesn't work (only uptime works, and that's
around 15k days :p)
i tried these:

<?php
$uptime_output = system("uptime" , $uptime_output) ;
print $uptime_output;
?>

<?php
$uptime = shell_exec("cut -d. f1 /proc/uptime");
$days = floor($uptime/60/60%24);
$hours = $uptime/60/60%24;
$mins = $uptime%60;
$secs = $uptime%60;
echo "current uptime is $days days, $hours hours, $mins minutes and
$secs seconds";
?>

but none of these works.

i 'd appreciate your help
tia, alex

Apr 10 '07 #1
0 1653

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1773
by: Noah | last post by:
I'm getting configure warnings and make errors when I try to build Python 2.3.4 under OpenBSD 3.5. I don't see anything in the README under "Platform specific note" for OpenBSD. I tried opening the Python tar file using gtar and I tried using gmake just to make sure there wasn't anything weird going on there (I know that using BSD tar when building Zope used to cause problems, so I first thought I might be having a similar problem. I'm...
8
5262
by: Oli Schwarz | last post by:
Hello, how can I read out the uptime of a unix system in python (Linux and *BSD). I have not found a uptime-function in the Library. Regards Oli
24
3092
by: Esmail Bonakdarian | last post by:
Hi, Is there a way to display how long a Win XP system has been up? Somewhat analogous to the *nix uptime command. Thanks, Esmail
2
3811
by: Steph L | last post by:
Hi, A given Milter program compiles ok on OpenBSD/FreeBSD/Linux but not on Solaris : it uses daemon(3) http://www.openbsd.org/cgi-bin/man.cgi?query=daemon&apropos=0&sektion =0&manpath=OpenBSD+Current&arch=i386&format=html http://www.freebsd.org/cgi/man.cgi?query=daemon&sektion=3&apropos=0 &manpath=FreeBSD+5.1-RELEASE
6
4325
by: MA | last post by:
Hi all! I know there is other newsgroups for webservices, but I don´t get any answers on those. I have developed a webservice that writeing and reading files in different folders. Question 1: I need to be able to stop this service by using a web interface
1
2091
by: Geoff | last post by:
Hi! I'm wanting to use openbsd to run a webserver because of its high security. The website is written in python. Before I was using linux with apache 2 and mod_python and this worked well. My problem is that mod_python 3.x does not work on apache 1 which is what comes with openbsd (and has been hardened buy the openbsd guys). One option is to use mod_python 2.x, but this has not seen any development since 2004. I'm now looking at...
1
2848
by: nazgul | last post by:
Hi all, I have an app that runs on multiple boxes. On my slackware box, running Python 2.5.1, top shows this: Mem: 1002736k total, 453268k used, 549468k free, 31392k buffers Swap: 2097136k total, 0k used, 2097136k free, 136876k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 2741 dnm 16 0 267m 261m 2676 S 99.3 26.7 14:54.62 python
5
2307
by: nazgul | last post by:
Hi all, In my prev post, I indicated I was using 2.5.1 on one box and 2.5p3 on the OpenBSD box. I'm trying to build 2.5.1 on OpenBSD and I get this: Modules/posixmodule.c:5701: error: `lstat' undeclared (first use in this function) I browsed the source and don't understand why I'm getting it. I'm not a configure expert, but I did figure out that pyconfig.h has these set:
8
2719
by: Guy Macon | last post by:
How to increase web server uptime with DNS failover: For illustration, let's start with some really bad hosting... Find four free web hosts that are each 90% reliable -- in other words they each are down on average one day out of ten. Use a failover DNS system with monitoring to switch servers if one fails. On average: One server will be down one day out of ten
0
8704
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9192
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8939
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8895
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6545
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3071
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2362
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.