Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Server reservation cgi

by logan (Curate)
on Dec 05, 2002 at 05:26 UTC ( #217684=perlquestion: print w/replies, xml ) Need Help??

logan has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,

I have a deceptively simple assignment, and I'm looking for a simple answer. I need to write a cgi for reserving unix servers. It's a simple chunk of code: display the list of machines and their particulars (free/busy, OS, current user, reservation dates), and allow people to check out a server for a specific time period if it's free.

Now, I'm by no means averse to writing it myself, as it doesn't seem like a difficult project. The thing I'm wondering is if it's been done before. I've done some searches in the usual places (CPAN, Sourceforge, etc), and found some large complex systems that are overkill for the task, but I can't seem to find a simple solution.

A cgi for reserving time on servers seems like the kind of project that's been done a hundred times before, and I see no reason to reinvent the wheel. Can anyone point me towards some code?

Thank you,

"What do I want? I'm an American. I want more."

Replies are listed 'Best First'.
Re: Server reservation cgi
by Cowbert (Initiate) on Dec 05, 2002 at 10:01 UTC
    There are several done in PHP, including LOCal. It is implemented using PHP and MySQL. Porting it to perl would be relatively simple.

    It's not entirely difficult to write one but when it comes down to feature implmentation it can get big quickly (need for user auth, users only modifying their own entries, admin functions, editing functions, aggregate functions, multiple display modes, as well as all the idiot-proofed form handling). The display modes that users might like to see are date-oriented (for those wanting to reserve "Next Tuesday") as well as summary list (show me everything reserved) including a grid view for a particular day. Aggregate handling features might include a facility for reserving regular usage "Bob runs a job every other Tuesday this month". The good news is, that the if statements that do automagic boundary checking to prevent double booking is all of 2 lines.

    ModPerl would probably be preferred over straight CGI because of the extensive form handling and html rendering required. Don't worry about re-inventing the wheel. I looked for ages for 3rd party OSS solutions and didn't find anything satisfactory, so I implemented my own. The advantages of rolling your own is because you maintain code base control, as well as being able to ubercustomize the application. Currently I regret the lack of code to post, because none of it is in perl :( (i'm a newbie to this forum) so you'll have to wait while I port some stuff over.
Re: Server reservation cgi
by Bukowski (Deacon) on Dec 05, 2002 at 10:19 UTC
    I have to say that whilst not a perly solution I use MRBS (Meeting Room Booking System) for this purpose. We use it to schedule time on all our lab equipment including the computers, its quick to set up, easy to modify and looks quite pretty (its PHP/MySQL).

    It allows repeated bookings etc etc and has an admin account and user accounts - its what keeps my workplace running smoothly ;)

    Bukowski - aka Dan (
    "Coffee for the mind, Pizza for the body, Sushi for the soul" -Userfriendly

Re: Server reservation cgi
by ibanix (Hermit) on Dec 05, 2002 at 09:01 UTC
    Well, you have a couple of options here:

    * Use Apache and mod_perl to write dynamic pages with perl.

    * Use (or this tutorial)

    * Use PHP again with Apache or your favorite webserver

    as far as the rest goes, you'll want to design the logic yourself, to fit your particular needs. It seems at the very least you'll want some sort of graphical calendar. HTML::Calendar::Simple might be able to help you.

    Good luck,

    $ echo '$0 & $0 &' > foo; chmod a+x foo; foo;

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://217684]
Approved by Courage
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2022-05-27 22:56 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (98 votes). Check out past polls.