Comment On Is the Mainframe On?

The asset management application used Alex R.'s company isn't exactly bad, but sometimes it can be a little bit of a pain. [expand full text]
« PrevPage 1 | Page 2 | Page 3Next »

Re: Is the Mainframe On?

2009-10-21 09:04 • by leppie (unregistered)
Is see no WTF here.

Online table schema update - OK
Run query - OK

Having paranoid network admins with crazy firewall rules - NOT SO OK

Re: Is the Mainframe On?

2009-10-21 09:09 • by Dizwell (unregistered)
Oh, the sensible comment (before my "Frist At Last!" one that has now been deleted!!) was that anyone attempting dynamic DDL in a function/procedure/package/whatever probably deserves all the performance woes heading their way.

(Says the man who inherited code which drops and creates entire tables by the bucketload for no discernable reason... OK, the reason was: a developer I wouldn't these days let within 100 yards of any database under my control. Just so happened he was my boss at the time...)

Re: Is the Mainframe On?

2009-10-21 09:15 • by Patrick (unregistered)
uh... ping much?

Re: Is the Mainframe On?

2009-10-21 09:17 • by Anonymous (unregistered)
Being able to run alter/update queries against a database does not mean that the database is running. Oh wait, yes it does.

Re: Is the Mainframe On?

2009-10-21 09:19 • by anon (unregistered)
WTF? WTWTF?
And what did this have to do with passwords?

Re: Is the Mainframe On?

2009-10-21 09:22 • by hikari
You'd think the fact that you managed to connect to the RDBMS on the mainframe might be enough of a clue that it was running.

Although, assuming you're using an established connection, it possibly won't actually notice the drop until you try and do something else. I'd just do something along the lines of "SELECT 1 FROM DUAL;" to get around that though.

Re: Is the Mainframe On?

2009-10-21 09:31 • by SuperAnalyst
I wouldn't call it a major wtf, but altering a table on the mainframe to check the connection status is a tad extreme!

Re: Is the Mainframe On?

2009-10-21 09:36 • by Matt (unregistered)
Is TRWTF here the use of a try catch in such a manner?

Re: Is the Mainframe On?

2009-10-21 09:37 • by Yardik (unregistered)
Umm for all the people who just commented...

1. Being able to connect to a database does not mean the MAINFRAME is up, they are likely two different systems. Perhaps the mainframe updates the column in the database to tell it "i'm up!" every so often.

2. Altering a table to add a column via DDL in production application code is just stupid. That is what release scripts are for.. This code is getting run over and over, whenever someone tries to log in, and throwing an exception when it doesn't work! Schema's don't change every day... update it once and forget about it.

Captcha: tego .... aren't those the stickers for cell phones?

Re: Is the Mainframe On?

2009-10-21 09:39 • by Crazyguy (unregistered)
288618 in reply to 288612
I've actually seen a case where the database server was up and running and actually answered to queries to check whether it was working (simple calculations). When any data was requested the database server hung though.

Can't remember what was done to fix that (could have been service restart).

Re: Is the Mainframe On?

2009-10-21 09:42 • by DBA-boy (unregistered)
The Real WTF (tm) is that no one is catching WOODEN_TABLE_NOT_FOUND.

Re: Is the Mainframe On?

2009-10-21 09:46 • by BSDman (unregistered)
288620 in reply to 288618
Is mainframe up?

1. ping MainframeName_Here
2. Host small intranet with PHP page to display info you want, like running services and their status.


Database != Mainframe. Mainframes MAY run databases but do not imply any relation....?? I'm so confused.

Re: Is the Mainframe On?

2009-10-21 09:46 • by dpm
288621 in reply to 288609
Patrick:
uh... ping much?
Not within an application, because a true ICMP request requires root (a.k.a. Administrator) privilege. Really.

Re: Is the Mainframe On?

2009-10-21 09:48 • by XIU
288622 in reply to 288621
dpm:
Patrick:
uh... ping much?
Not within an application, because a true ICMP request requires root (a.k.a. Administrator) privilege. Really.


I can ping in Win7 without having to run as admin, and .NET also has a class to ping without needing admin access.

Re: Is the Mainframe On?

2009-10-21 09:49 • by Jim (unregistered)
ALTER TABLE [Comment] ADD frist bit, first bit, fist bit

UPDATE [Comment] SET frist = 1...tbc

Re: Is the Mainframe On?

2009-10-21 09:50 • by LAN Mind (unregistered)
TRWTF is everyone who commented to say they don't see a WTF in this code.

Captcha - transverbero. WTF?

Re: Is the Mainframe On?

2009-10-21 09:53 • by Anonymous (unregistered)
288626 in reply to 288621
dpm:
Patrick:
uh... ping much?


Not within an application, because a true ICMP request requires root (a.k.a. Administrator) privilege. Really.


which is why you have /sbin/ping suid root. oh wait, its basic, so its probably not an unix box... oh wait, that also explains the login slowness... where's the WTF, is the general dumbness of not using a proper OS?

Re: Is the Mainframe On?

2009-10-21 09:53 • by bob171123
288627 in reply to 288622
XIU:
dpm:
Patrick:
uh... ping much?
Not within an application, because a true ICMP request requires root (a.k.a. Administrator) privilege. Really.


I can ping in Win7 without having to run as admin, and .NET also has a class to ping without needing admin access.

Win7 FTW!!!

Re: Is the Mainframe On?

2009-10-21 09:55 • by Rootbeer (unregistered)
Why would a mainframe -- a type of computer designed with reliability and availability as driving factors, and the price tag to prove it -- ever, EVER not be online?

Re: Is the Mainframe On?

2009-10-21 09:58 • by dpm
288630 in reply to 288622
XIU:
dpm:
a true ICMP request requires root (a.k.a. Administrator) privilege. Really.
I can ping in Win7 without having to run as admin
That only works because the PING.EXE file has the "setuid" bit set.
and .NET also has a class to ping without needing admin access.
I doubt that very much. Details, please?

Re: Is the Mainframe On?

2009-10-21 10:00 • by pitchingchris
288631 in reply to 288628
Rootbeer:
Why would a mainframe -- a type of computer designed with reliability and availability as driving factors, and the price tag to prove it -- ever, EVER not be online?


Somebody unplugs a router/switch ? Power surge fries NIC? Come on, there are a million things that could make a mainframe unavailable to a particular app. Are you serious?

Re: Is the Mainframe On?

2009-10-21 10:07 • by Resa (unregistered)
I don't know if it's a wtf, but it's pretty dumb.

Re: Is the Mainframe On?

2009-10-21 10:16 • by Win7 FTW!!! (unregistered)
288633 in reply to 288627
bob171123:
Win7 FTW!!!


You do realise that FTW is WTF backwards...

Re: Is the Mainframe On?

2009-10-21 10:17 • by dtech
288634 in reply to 288630
dpm:

and .NET also has a class to ping without needing admin access.

I doubt that very much. Details, please?


System.Net.NetworkInformation.Ping...
Found by googling ".NET ping", 3rd hit...

Re: Is the Mainframe On?

2009-10-21 10:25 • by dkf
288636 in reply to 288630
dpm:
XIU:
and .NET also has a class to ping without needing admin access.
I doubt that very much. Details, please?
It could be running a subprocess to do it behind the scenes (or asking a suitably-authorized service, which might actually be slightly more elegant). The problem with ICMP is that code that does it works with raw sockets, and there's traffic at that level that normal user code should not interfere with (e.g., ARP). If it was only ICMP ECHO, nobody would be very bothered.

Of course, for a real heartbeat you need more than ping. It's better to use a service that's hosted inside the same connection infrastructure (software server, physical server, etc.) as the real service that you're keeping an eye on. Why? Because it's quite possible to have a machine that responds to ping without a working userland, or a working userland but no software service container, or a service container but no service instance, or… I've seen all of these happen for real. The closer you put the heartbeat to the thing that you're really monitoring, the better. (Only idiots and network admins rely on ping for monitoring, and netadmins should know what it is actually doing.)

Re: Is the Mainframe On?

2009-10-21 10:30 • by @Deprecated (unregistered)
288637 in reply to 288628
Rootbeer:
Why would a mainframe -- a type of computer designed with reliability and availability as driving factors, and the price tag to prove it -- ever, EVER not be online?


Uhhh, 'cuz the cleaners need that electrical socket to polish the floors on Fridays at 1745?

Re: Is the Mainframe On?

2009-10-21 10:32 • by erica (unregistered)
The issue is not whether the mainframe is on. It probably is 24x7 and extra on Daylight Savings day shift.

The issue is whether particular applications on the mainframe are running and accepting inputs. (They may be running, but in maintenance mode, so users have to wait for them to re-open).

Whether a test of changing a table is the best way to decide that, is a interesting question. My best guess would be no, but then I do not have access to the change log that shows the previous attempts to solve the issue.

Re: Is the Mainframe On?

2009-10-21 10:33 • by oldami (unregistered)
288639 in reply to 288634
Nothing mentioned there about access restrictions. ???

I have used every version of windows since 3.0 as well as most flavors of Unix/Linux. I have NEVER seen a restriction on using ping. Ever.
What have you been smoking?

Sure, if you tried to do it thru raw sockets, then you would have a problem. That's why MS supplies the icmp.dll library. I've used it many times. No admin access required.

Re: Is the Mainframe On?

2009-10-21 10:43 • by Mats (unregistered)
288641 in reply to 288639
I am fresh from college and our network ignores ICMP pakets, all of them!

Re: Is the Mainframe On?

2009-10-21 10:44 • by M.C. (unregistered)
The Real WTFs are 'application used Alex R.'s company isn't exactly bad' and 'deveoper'.

Re: Is the Mainframe On?

2009-10-21 10:48 • by David Hamilton (unregistered)
I would be fascinated to see what the application does if the mainframe is not online.
I bet it just brings up a message stating "System Unavailable"!

Re: Is the Mainframe On?

2009-10-21 10:48 • by Carl (unregistered)
288645 in reply to 288627
bob171123:
XIU:
I can ping in Win7 without having to run as admin, and .NET also has a class to ping without needing admin access.

Win7 FTW!!!

This has to be a troll, because non-admin ping has been available since at least 15 years ago and I would guess a lot longer than that.

On the other hand, there are so many handy and timesaving features more than a quarter century old now that GUIs still haven't figured out how to implement* that I guess all you can celebrate are the pathetic gains of the latest minor tweak.

* For just one example: typeahead. Why should you ever have to wait on your computer, when it has enough memory to buffer more key presses than you could make in an entire day?

Re: Is the Mainframe On?

2009-10-21 10:56 • by Plz Send Me The Code (unregistered)
So why was there a pause at login again? Because of a query against the database?

Re: Is the Mainframe On?

2009-10-21 11:08 • by Greg (unregistered)
288648 in reply to 288622
XIU:
dpm:
Patrick:
uh... ping much?
Not within an application, because a true ICMP request requires root (a.k.a. Administrator) privilege. Really.


I can ping in Win7 without having to run as admin, and .NET also has a class to ping without needing admin access.


Finally found the WTF, you're using Microsoft as your reference for how a standard should work?

Re: Is the Mainframe On?

2009-10-21 11:16 • by dpm
288649 in reply to 288645
Carl:
non-admin ping has been available since at least 15 years ago
I said, "a true ICMP request", which uses raw sockets, for which you do indeed need root.

Re: Is the Mainframe On?

2009-10-21 11:20 • by Neville Flynn (unregistered)
288650 in reply to 288642
M.C.:
The Real WTFs are 'application used Alex R.'s company isn't exactly bad' and 'deveoper'.


It's like a drunken Yoda this article wrote.

Captcha: validus... Darth Validus.

Re: Is the Mainframe On?

2009-10-21 11:27 • by luis.espinal
288652 in reply to 288649
dpm:
Carl:
non-admin ping has been available since at least 15 years ago
I said, "a true ICMP request", which uses raw sockets, for which you do indeed need root.


In that case, your comment is not applicable since, from the logical view of an app, a ping is a ping. For the app, whether it is a true ICMP request or a non-admin ping is irrelevant. Non sequitur.


Focusing on the need (justified or not) to exec something that acts like a ping, I've never seen such a restriction (unless a sysadmin explicitly chmod 744 on ping.)
Been working with NT/XP, Solaris, HP, AIX, several specimens the Linux bestiary, for almost 15 years, and I've never seen a intrinsic restriction of an app not running as root spawning/forking a ping.

In general, nothing prevents an app on windows from spawning a shell command running ping. And in *nix platforms, applications run under specific users that might belong to groups. I can give any of these groups access to ping if I need to.


On another note, even testing if a mainframe (or whatever) is up via ping is usually a brainf1rt.

Instead of testing for physical server availability, you check for service availability. If it runs on somehost, and if it runs on TCP on port 1234, you simply attempt to establish a telnet connection to that port (or a TCP connection pro grammatically from within the application). If the service is up, you'll get the telnet connection (or tcp connection). You can't do anything with it since the service is not really telnet, but that's beyond the point. You got the connection - proof that it is up.

Re: Is the Mainframe On?

2009-10-21 11:30 • by Jesse (unregistered)
First... Instead of trying to add a column and see if it would fail, you can check if it exists and add it if not.

Second... If you set the default to 1, you can skip the initial setting of the column value.

Third... Why th ehell has the user connecting to teh database the rights to change the schema?

Last... Exit try, empty try catch boxes, no try catch on the last statement... ARGH!

(hehe CAPTCHA: damn um )

Re: Is the Mainframe On?

2009-10-21 11:35 • by dpm
288654 in reply to 288652
luis.espinal:
Focusing on the need (justified or not) to exec something that acts like a ping, I've never seen such a restriction (unless a sysadmin explicitly chmod 744 on ping.)
I'm not sure what you're saying here. Every unix system I've seen has /bin/ping installed "setuid root", and Windows boxes have the equivalent. So any used can run the program, and temporarily has root access so that the attempt to use raw sockets will succeed.

Re: Is the Mainframe On?

2009-10-21 11:36 • by snoofle
288655 in reply to 288628
Rootbeer:
Why would a mainframe -- a type of computer designed with reliability and availability as driving factors, and the price tag to prove it -- ever, EVER not be online?
Because the cleaning crew came through and needed the outlet?
Edit: nuts; someone beat me to it!

Re: Is the Mainframe On?

2009-10-21 11:45 • by Some Unix Guru (unregistered)
288657 in reply to 288626
Anonymous:
dpm:
Patrick:
uh... ping much?


Not within an application, because a true ICMP request requires root (a.k.a. Administrator) privilege. Really.


which is why you have /sbin/ping suid root. oh wait, its basic, so its probably not an unix box... oh wait, that also explains the login slowness... where's the WTF, is the general dumbness of not using a proper OS?


QFT.

"Those who don't understand UNIX are condemned to reinvent it, poorly." – Henry Spencer

Q.E.D. Microsoft Windows

Re: Is the Mainframe On?

2009-10-21 12:06 • by dtfhg (unregistered)
288659 in reply to 288641
I can guarantee you they won't ignore the RCMP though!

Re: Is the Mainframe On?

2009-10-21 12:31 • by akatherder
288662 in reply to 288647
Plz Send Me The Code:
So why was there a pause at login again? Because of a query against the database?


I'll summarize. There are two systems. A database and a mainframe. When the users try logging into the mainframe, a script checks the database to see if the mainframe is currently available. It is this "check" shown in the code, that creates the pause.

The idea of checking a database, to see if a mainframe is available, is questionable. There were a couple other reasons mentioned, but if your database server goes down, you probably just blocked the front door to your mainframe also (based on the level of forethought by the developer).

The way that they are checking the database is certainly a WTF. You have some serious issues if you need to check that a column exists in a table before you query the column. And the way they check is just silly (by adding the damn column and erroring if it already exists).

Re: Is the Mainframe On?

2009-10-21 12:46 • by GrumpyOldGeek (unregistered)
288664 in reply to 288641
As soon as you get a little experience, it will start responding to them.

Re: Is the Mainframe On?

2009-10-21 12:56 • by Yanman (unregistered)
Pong>Ping

Re: Is the Mainframe On?

2009-10-21 13:16 • by Bim Job (unregistered)
288667 in reply to 288657
Some Unix Guru:
Anonymous:
dpm:
Patrick:
uh... ping much?


Not within an application, because a true ICMP request requires root (a.k.a. Administrator) privilege. Really.


which is why you have /sbin/ping suid root. oh wait, its basic, so its probably not an unix box... oh wait, that also explains the login slowness... where's the WTF, is the general dumbness of not using a proper OS?


QFT.

"Those who don't understand UNIX are condemned to reinvent it, poorly." – Henry Spencer

Q.E.D. Microsoft Windows
Apparently, you've never heard of Multics.

There are three (I'm open to alternatives) descendents of Multics.

One of them was VMS. We'll deal with that later.

The second was Stratus VOS. I'd argue that VOS was the ultimate Multics ... but it was tied to the hardware, and couldn't compete.

The third, and most pitiful, was Unix. Oh, joy! Suddenly, an operating system that makes PDP-7/9/11s look useful!

Sadly, or not -- and it's a shame to have to give up on 1970s OSes -- nobody in their right mind would listen to Henry. Linux, for example, is Unix reinvented poorly. Tubularly poorly.

VOS was a damn good shot. VMS is now (buggered up as) Windows, and it just about makes the grade. OSX is a decent facade in front of a decent BSD implementation.

Other than that: Spencer is talking out of his arse.

Time for a CAP micro-kernel, I think. And bollocks to Posix compliance.illum

Re: Is the Mainframe On?

2009-10-21 13:30 • by Harold (unregistered)
288668 in reply to 288604
I think the people that thought the database was on the mainframe are wrong. The database has the status of the mainfrme in it. The first time it tries to check the status, the table is altered,and the table is updated to say if the databse is up or not. It appears that the code:

If _Settings.GetSetting("General", "MainframeOn", False) Then t = "1"

indicates the state of the mainframe, as this is used to update the table.

After the first time, the table will just be queried. But the table is not correct is it? why not just execute that line of code related to GetSetting?

That's The real WTF isn't it?

Re: Is the Mainframe On?

2009-10-21 13:38 • by Kang (unregistered)
288669 in reply to 288604
Who runs code...prior to any login...with ALTER DB permissions?

Re: Is the Mainframe On?

2009-10-21 13:54 • by Jeremy (unregistered)
288670 in reply to 288669
Kang:
Who runs code...prior to any login...with ALTER DB permissions?

I do. I'm an SQL injection hacker...

Re: Is the Mainframe On?

2009-10-21 14:03 • by Satanicpuppy
288671 in reply to 288609
Patrick:
uh... ping much?


Ping doesn't cut it if what you care about encompasses more than just the network subsystem. You can lose your database without losing the server.
« PrevPage 1 | Page 2 | Page 3Next »

Add Comment