In this case, you want to know if it's Debian or Fedora so you know
where to look for the log files and what format to expect the log
files in. There's no built-in pre-existing way to find out what
distribution you're on; so look for the log files in both places and
parse them according to the format you'd expect them to be if they
were there. Problem solved.
You don't understand the concept of a team here. Imagine (just a
scenario from a lot of possibles) this :
Now : I have to guess what the logs and trees are : so, what you say is
correct : I could just check and try these logs and tress.
In two weeks : Philip (a friend of mine in the team) has to auto-
generate a report from a Perl CGI script which just write the exact
linux ditribution in the subtitle of every report : unfortunately he
can't re-use what I've done because I'm a well known selfish.
Maybe more, I can't add in my own task myself because I need he finish
his own.
One week later : Samantha (yeah), collect the Philip's reports of the
last week and try to establish some statistics based on specific linux
distributions indicated on every report. Also, she wants (and when
Samantha wants, you can imagine...) to compare these statistics about a
week against the current states (close to "realtime") of the servers
park, reusing, again, the same piece of Perl code I've written (and
which has been modified, maybe, by Philip) tree weeks ago.
More, because she is a consultant, we've kept some money which will have
more chance to go in Philip and mine's pockets (oh, no!, big boss is
watching us ;-))
Well, so I don't target Y ignoring X without valid reason but because of
long experience in the concept of team !
Well, this said, I've found a begin of answer some minutes ago :
http://search.cpan.org/~kerberus/Linux-Distribution-
0.14/lib/Linux/Distribution.pm