Ok, so there are two options for finding the data you are looking for:
Unix commands and Oracle database.
I think Oracle is the way to go, as Unix wtmp files are deleted now and then, depending on your flavour of Unix. Probably you can't go back 180 days.
Implementing a Unix-only solution might be easier though.
'Parsing' here just means using commands like grep, awk, cut and so on to extract the interesting piece of information from the output of 'last' command.
In Oracle it is quite easy to find a user_id with a last_login_dt older than 180 days. I presume last_login_dt is datatype date:
select user_id from users where last_login_dt < sysdate - 180
However there may be the additional problem of finding users who never logged in, and for whom there is no last_login_dt. You could use another table that contains all the users.
And then you will need some interaction between Unix and Oracle;
for a start look at faq186-2220
hope this helps