• (cs) in reply to Harold
    Harold:
    I think the people that thought the database was on the mainframe are wrong.
    Based on what, exactly? The story gives no clue one way or the other. What makes you think that _Settings.GetSetting isn't just some default value from an ini file somewhere? "Settings" would be a pretty strange way to describe something that checks the current status of something after all, that's not a setting, it's a status.

    TRWTF is the poorly written and ambiguous story. The needlessly-vague-in-a-misbegotten-attempt-to-sound-cool-and-laid-back phrase "querying a column in some database table" is a lousy choice of wording since that "some" elides the one vital piece of information that would let us understand the entire article.

  • bofh (unregistered) in reply to luis.espinal
    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.) 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.

    If, after 15 years using unix, you feel that these privileges are of use to anyone, then some time spent on the basics would be well spent.

  • mh (unregistered)

    Not to mention that it doesn't even need to use the database because it already knows if the mainframe is on or not as a result of the check.

  • Paula (unregistered)

    Ask Rumen if the mainframe is on.

  • Zack Jones (unregistered) in reply to Paula
    Paula:
    Ask Rumen if the mainframe is on.

    HA HA HA! Good one Paula!

    The WTF with the code is every time it runs it adds a new column called MainframeOn to that datbase table. Eventually it should error out once it reaches the maximum number of columns per table.

    Captcha: Let Go My Ego???

  • Timmy (unregistered)

    The additional minor-WTFs are the repeated posts insisting that ping.exe on Windows is setuid root, or the Windows equivalent. There isn't a Windows equivalent for a start, and for a finish ping.exe is a normal binary.

    None of this setuid fruityness kthxbaibbqroflcopter!

    tm

  • David (unregistered)

    So why can't they just rely on a TCP connection attempt to check if it's online? If it connects, then it's online. If it timeouts then it's offline.

  • (cs) in reply to Bim Job
    Bim Job:
    Linux, for example, is Unix reinvented poorly. Tubularly poorly.
    Please elaborate.
    Bim Job:
    Time for a CAP micro-kernel, I think.
    I have no problem with that. Get porting to Minix.
    Bim Job:
    And bollocks to Posix compliance.illum
    What alternative standard would you propose?
  • falsedan (unregistered) in reply to Jesse

    using exceptions to handle your expected-case scenarios is not the right way; (only a little bit) better to try to retrieve the value, and on exception, add the column.

  • (cs) in reply to bofh
    bofh:
    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.) 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.
    If, after 15 years using unix, you feel that these privileges are of use to anyone, then some time spent on the basics would be well spent.
    What privileges? What basics? Please be more specific when being snarky.
  • (cs) in reply to Zack Jones
    Zack Jones:
    Paula:
    Ask Rumen if the mainframe is on.

    HA HA HA! Good one Paula!

    The WTF with the code is every time it runs it adds a new column called MainframeOn to that datbase table. Eventually it should error out once it reaches the maximum number of columns per table.

    Captcha: Let Go My Ego???

    No it doesn't - it's "Expection Handling" - if you try to add a column that already exists, there will be an exception thrown. Since the developers obviously knew this was a possibility, they should have checked for existence of the column, rather than just trying to add it every time. Or better yet, assume that the schema is correct and keep DDL where it belongs.

    The second bit of code is less of a WTF, but still a little off, because the database response doesn't necessarily indicate that the mainframe is running - unless the database runs on the mainframe and it's the only service you care about, in which case there is a much better way of checking to see if the database is responding.

    The overall WTF, for me anyway, is that there is specific code to check if vital services are running, and it's part of the user login for a client application. I've seen this done in rare cases, but usually, you just have the client application do whatever it is going to do, and you handle the errors when they happen, rather than checking to see if any errors might happen and then doing what you are going to do sometime later. The problem is that maybe the mainframe is running just fine when the user logs in, and then some time later, the mainframe is not running when the client attempts something, but the lazy programmer doesn't handle the error correctly, because hey, they already checked to see if the mainframe is on.

    So IMO, the proper way to code this would have been to just have the client application attempt a login, and if an exception is thrown such as "mainframe could not be reached" then you handle the error at that point.

  • Some Dude (unregistered) in reply to Jeremy
    Jeremy:
    Kang:
    Who runs code...prior to any login...with ALTER DB permissions?
    I do. I'm an SQL injection hacker...
    You hack SQL injections?

    That's like buttering butter.

  • Ben (unregistered)

    Why even bother checking if the mainframe is on?

    If it's not on, the user probably can't access the website.

    That's like using JavaScript to detect JavaScript, or making an EXE that only checks to see if you're running Windows.

    #define THIS_CODE_WAS_WRITTEN_IN_C TRUE
  • (cs)

    I see the WTF: ExecuteNonQuery. "ALTER TABLE [Mainframe] ADD MainframeOn Bit" sure looks like a query to me; it should be passed to ExecuteQuery!

  • (cs) in reply to lolwtf

    No, it's not a query. It does not return data. Look up "query" in a dictionary...

  • Steve P (unregistered) in reply to @Deprecated
    Deprecated:
    Uhhh, 'cuz the cleaners need that electrical socket to polish the floors on Fridays at 1745?

    Oh, those mainframes that use regular 13-amp sockets?

    Yeah, you get a lot of those around. I think Dell make a few of those.

    On a slightly more sensible note, SunCluster's HA-Oracle agent connects to the database and gets some status data from the database to check that the database is online. That is all after checking that the machine responds to pings, is talking over the private interconnect, has access to the storage, and so on, but to be fully confident that the service is actually usable (as opposed to hung-but-answering-ping-requests) it will query the database instance.

    Other SunCluster agents do do similar tests - again, phased to allow for the range between "the other server disappeared totally" (take control immediately to avoid data corruption) down to "the other server seems fine, but let's check what the users would see" (allow the other node to die or come back online before taking more drastic action).

    VCS can do similar things; actually, it's the norm for resilient systems - it is a requirement.

    Not everything is Microsoft...

  • (cs) in reply to dtfhg
    dtfhg:
    I can guarantee you they won't ignore the RCMP though!
    The Royal Canadian Mounted Police?
  • (cs) in reply to dwilliss
    dwilliss:
    dtfhg:
    I can guarantee you they won't ignore the RCMP though!
    The Royal Canadian Mounted Police?
    They always get their PING!
  • Laughing Jack (unregistered) in reply to Some Dude
    Some Dude:
    That's like buttering butter.

    Don't knock buttered butter. It's delicious. I want to stuff nob after nob of delicious buttered butter into my festering gob, as tears of joy roll down my cheeks.

  • Carl (unregistered) in reply to snoofle

    The cleaning crew is not supposed to come near your mainframe.

    In general, "mainframe" relates to IBM System Z nowadays. If you own such a box, you pay massive amounts of money just to ensure that systems are online. 24x7x365.

    So, when your IT department is charged tons of money every month for your mainframe ... these folks will make sure that noone comes near their sacred box.

  • EPE (unregistered)

    Why should an "asset management application" check whether the mainframe is on? Just use whatever resources you need to use when you need them; if such resources are unavailable, act accordingly, but a previous check is unneeded.

  • Eros (unregistered) in reply to Carl
    Carl:
    The cleaning crew is not supposed to come near your mainframe.

    In general, "mainframe" relates to IBM System Z nowadays. If you own such a box, you pay massive amounts of money just to ensure that systems are online. 24x7x365.

    So, when your IT department is charged tons of money every month for your mainframe ... these folks will make sure that noone comes near their sacred box.

    Nice theory... I know a bank where a "IBM System Z" was unplugged by a technician to replace a broken bulb; a real situation, not a theory.

  • (cs) in reply to Carl
    Carl:
    In general, "mainframe" relates to IBM System Z nowadays. If you own such a box, you pay massive amounts of money just to ensure that systems are online. 24x7x365.
    365 weeks a year? That is impressive uptime!
  • (cs) in reply to SCB
    SCB:
    Carl:
    In general, "mainframe" relates to IBM System Z nowadays. If you own such a box, you pay massive amounts of money just to ensure that systems are online. 24x7x365.
    365 weeks a year? That is impressive uptime!
    Nah, it's a seven year contract.

    (One day downtime every four years, you'll note.)

  • (cs) in reply to Some Dude
    Some Dude:
    Jeremy:
    Kang:
    Who runs code...prior to any login...with ALTER DB permissions?
    I do. I'm an SQL injection hacker...
    You hack SQL injections?

    That's like buttering butter.

    Buttered butter is the best butter there is.

  • Mayhem (unregistered) in reply to Eros
    Eros:
    Carl:
    The cleaning crew is not supposed to come near your mainframe.

    In general, "mainframe" relates to IBM System Z nowadays. If you own such a box, you pay massive amounts of money just to ensure that systems are online. 24x7x365.

    So, when your IT department is charged tons of money every month for your mainframe ... these folks will make sure that noone comes near their sacred box.

    Nice theory... I know a bank where a "IBM System Z" was unplugged by a technician to replace a broken bulb; a real situation, not a theory.

    Heh. My bank had its datacentre go down when you turned on the lights.
    AS400s don't like power faults at all, and we found the System Z is much less tolerant than the windows boxes to momentary interruptions. Longer version : Emergency power cutout breaker located in false wall by door had wire work loose over time, vibration from pushing the adjacent light switches firmly was enough to make the wire jump & cut the power briefly.

  • anon (unregistered) in reply to Bellinghman
    Bellinghman:
    SCB:
    Carl:
    In general, "mainframe" relates to IBM System Z nowadays. If you own such a box, you pay massive amounts of money just to ensure that systems are online. 24x7x365.
    365 weeks a year? That is impressive uptime!
    Nah, it's a seven year contract.

    (One day downtime every four years, you'll note.)

    Only 3-nines reliability then

  • anon (unregistered) in reply to anon

    or do I mean 5?

  • SB (unregistered) in reply to Bellinghman
    Bellinghman:
    SCB:
    Carl:
    In general, "mainframe" relates to IBM System Z nowadays. If you own such a box, you pay massive amounts of money just to ensure that systems are online. 24x7x365.
    365 weeks a year? That is impressive uptime!
    Nah, it's a seven year contract.

    (One day downtime every four years, you'll note.)

    Isn't it a 49.1346154 year contract ?

  • Bim Job (unregistered) in reply to DaveK
    DaveK:
    dwilliss:
    dtfhg:
    I can guarantee you they won't ignore the RCMP though!
    The Royal Canadian Mounted Police?
    They always get their PING!
    Stop that at once, Neddie.
  • London Developer (unregistered) in reply to @Deprecated
    @Deprecated:
    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?

    Hahahahaha!!! You read this site as much and for at least as long as me!!!

    Wow! Big Captcha! ullamcorper???

  • dag (unregistered)

    What, nobody mentioned 'int32 is_computer_on()'?!?

    Surely there's a ASP.NET, VB.NET, or PHP equivalent.

  • (cs) in reply to Bombe
    Bombe:
    Some Dude:
    Jeremy:
    Kang:
    Who runs code...prior to any login...with ALTER DB permissions?
    I do. I'm an SQL injection hacker...
    You hack SQL injections?

    That's like buttering butter.

    Buttered butter is the best butter there is.

    Nonsense! Garlic butter is the best butter there is. It's the Ultimate Axiom of Food Perfection!
  • (cs) in reply to Bim Job
    Bim Job:
    DaveK:
    dwilliss:
    dtfhg:
    I can guarantee you they won't ignore the RCMP though!
    The Royal Canadian Mounted Police?
    They always get their PING!
    Stop that at once, Neddie.
    Needle nardle noo!
  • (cs) in reply to dpm
    dpm:
    Patrick:
    uh... ping much?
    Not within an application, because a true ICMP request requires root (a.k.a. Administrator) privilege. Really.
    Nope that's wrong! Not unless your SysAdmin's are total control freaks. Most linux/windows boxes I run can ICMP fine. tracert using ICMP sometimes gives a security message.

    I think you might just be a dirty mac user

  • Bim Job (unregistered) in reply to codeReign
    codeReign:
    dpm:
    Patrick:
    uh... ping much?
    Not within an application, because a true ICMP request requires root (a.k.a. Administrator) privilege. Really.
    Nope that's wrong! Not unless your SysAdmin's are total control freaks. Most linux/windows boxes I run can ICMP fine. tracert using ICMP sometimes gives a security message.

    I think you might just be a dirty mac user

    I've messed around with Unix security a lot, and there are worse things than ICMP. And, as far as I'm concerned, all SysAdmins are total control freaks. Not to mention a pointless irrelevance.

    Nevertheless, I can't see a good reason (as long as you're co-located) not to ban ICMP via a firewall. It's too high-level to be safe, and too low-level to be useful.

    Needle nardle noo!

  • softwarebear (unregistered)

    What happens if MainframeOn = 0 ?

  • BSDman (unregistered) in reply to akatherder

    The funny part is that I have just tested this after about 2 minutes of reading some recordset docs.

    If rs.State = 0 Then \tMsgBox "Something must be wrong." EndIf

    If you ping, you are checking if the MAINFRAME is UP! Which is the goal. If you want to check of the DB on the mainframe is running as service (use your service manager status output). If you want to see if the Mainframe is up, the DB service is running AND that the DB is functioning, check the DB State.

    THAT is the WTF. I don't see why this isn't obvious for people.

  • (cs) in reply to bofh
    bofh:
    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.) 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.

    If, after 15 years using unix, you feel that these privileges are of use to anyone, then some time spent on the basics would be well spent.

    Likewise, it would be wise for you to spend some time with the basics of reading comprehension. I did not say "anyone". I challenge you to pinpoint where I said or implied "anyone" (or at least a piece of text that I wrote that can be construed as such under the widest of interpretations.)

    Let's go back to the opening salvo by dpm (or you if you happen to be dpm's sock puppet which in the land of the interweebz it's all too common.)

    dpm:
    Patrick:
    uh... ping much?
    Not within an application, because a true ICMP request requires root (a.k.a. Administrator) privilege. Really.

    Every application runs under a user (nobody, root, a domain/app-specific user.) For nobody and root, we don't need to discuss anything further. For domain-specific users, you assign them to a given group with certain privileges, including if you wish, the ability to execute certain functions that are otherwise privileged.

    And in cases where (using PING or whatever ICMP functionality you want to) something is strictly off-limits to anyone but root (due to x/y process in place), you can still have a process running as root under control (.ie. a chroot jail) performing the function in question, and writing its output to an IPC/temp file/whatever-messaging-mechanism to be read on the other end by the application in question running under the domain-specific user with restricted access.

    Restrictions would also happen at the firewall level .ie. not allowing ICMP packets traveling except to certain locations (.ie. from the app host to the mainframe to be poked for liveness.)

    You might want to spout about spending time with the basics, but it seems that you have lost the basics yourself, not to mention that you fail at reading comprehension.

    In summary:

    • I did not say that ICMP privileges are/should be of use to anyone.
    • I said that there are no intrinsic barriers for their execution, sans an admin puts them in place.
    • Any app running under a non-root, domain-specific user can execute privileged functions if the domain-specific user is given access to them (be it by design or accident, which the subject of a different topic altogether.)

    Anyone who thinks otherwise is either a sysadmin control freak living in a dark, secluded sysadmin cave with little exposure to the realities of application development/support or someone enamored with a book on ICMP (theory, but no practice.)

    You make it sound as if we are trying to mix oil and water (OMG! user can haz! ICMP, impozzibel division by 0!!(eleven)- we are not. There is nothing intrinsic/built-in that stops a non-root user from doing so, which is how your first post reads - whether that's what you meant or whether that's how it got written by poor communication skills, I don't know.

    If you still think I'm claiming anyone should have these privileges (so that you can have an argument to point a finger at), please do so.

    I'm not one to judge your lifestyle, so long as you don't complain when you get splinters from screwing that strawman of yours.

  • (cs) in reply to Bim Job
    Bim Job:
    codeReign:
    dpm:
    Patrick:
    uh... ping much?
    Not within an application, because a true ICMP request requires root (a.k.a. Administrator) privilege. Really.
    Nope that's wrong! Not unless your SysAdmin's are total control freaks. Most linux/windows boxes I run can ICMP fine. tracert using ICMP sometimes gives a security message.

    I think you might just be a dirty mac user

    I've messed around with Unix security a lot, and there are worse things than ICMP. And, as far as I'm concerned, all SysAdmins are total control freaks. Not to mention a pointless irrelevance.

    Nevertheless, I can't see a good reason (as long as you're co-located) not to ban ICMP via a firewall. It's too high-level to be safe, and too low-level to be useful.

    Needle nardle noo!

    Exaaaactly! That's how it's done first and foremost, not by setting up all potentially risky funcs exclusively to root.

  • Lego (unregistered) in reply to Laughing Jack
    Laughing Jack:
    Some Dude:
    That's like buttering butter.

    Don't knock buttered butter. It's delicious. I want to stuff nob after nob of delicious buttered butter into my festering gob, as tears of joy roll down my cheeks.

    The mark of a true gourmand! You win.

  • Brillant (unregistered) in reply to Some Dude
    Some Dude:
    You hack SQL injections?

    That's like buttering butter.

    Mmmmmm....that's my lunch. Buttered butter, with a marble-rye-on-toasted-whole-wheat sandwich on the side.

  • Zack Jones (unregistered) in reply to jasmine2501

    jasmine2501: My bad. You're right trying to add a column that already exists would throw and exception.

  • Kris (unregistered)

    what the hell is this?? database runs on mainframe. if mainframe up db up. is db up? select 1 from dual;

    -- 1

    it's up.....

    done. DDL? convolutions? madness! KISS....

  • Kris (unregistered) in reply to BSDman

    errr...

    nooooo......

    what happens if the mainframe is in a maintenance state, only accessible by the console op or at a run level where ping will wok but users cannot login?

    I think it is about context - is the mainframe from the viewpoint of users who want to use the system

  • (cs)

    A good word for 'ping'. I use ping from my notebook computer in Thailand; I ping my server in Singapore. The IP address is in /etc/hosts; no need for DNS. What does this tell me? It tells me that I can get to the Internet. My router is working, my ADSL is working, the ISP's network is working, and the national gateway to the global Internet is working. This is valuable information. If necessary I can 'ping yahoo.com' to see whether DNS is working.

  • Zx (unregistered)

    In most places, if the mainframe is down, making sure that some program works ok in that situation is a very minimal problem.

    But, even if you need to check for write access there is no justification for altering a table instead of inserting a row somewhere :-). Maybe there was a good reason to do it like that... We'll never know...

  • Fred (unregistered)

    OK I know nobody is reading this because I'm two days late to the party, but I just wanted to tell the silent uncaring world that "Is the Mainframe On" was published on the same day that we finally shut our last mainframe down forever. (sniff)

    "Those who do not understand the mainframe are condemned to reinvent it, poorly." -- with apologies to Henry Spencer

  • Angelus (unregistered) in reply to Yardik
    Yardik:
    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.

    As opposed to sending "I'm down!" whenever it crashed?

  • aristos_achaion (unregistered) in reply to bob171123
    bob171123:
    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!!!
    Win7 WTF!!!

Leave a comment on “Is the Mainframe On?”

Log In or post as a guest

Replying to comment #:

« Return to Article