More robust machine_type and pid detection

Signed-off-by: Zack Cerza <zack.cerza@inktank.com>