How to programatically get the machine name of a node?
Individual nodes don't have machine names in Drupal 6 or 7, so you can't.

If you want a unique ID for each node, and Node ID won't do (for staging or migration for example), then try taking a look at the UUID module.


  This module provides an API for adding universally unique identifiers
  (UUID) to Drupal objects, most notably entities.


Also of note...


  Features in Drupal 6 version
  
  
  Automatic UUID generation for nodes, node revisions, users and taxonomy.
  Allow choosing which content types and vocabularies to create UUIDs for.
  Option to batch create UUIDs for objects which don't have it already.
  


If, however, you want the node TYPE to be available to your template, and you have the node object, it should be under $node-&gt;type, or possibly $vars['type'].