ec2metadata: command not found

Have You tried accessing the binary with the full path?

Maybe Your $PATH variable doesn't contain the default paths? echo $PATH should give something like:

[root@server ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

If it's empty, You may set the PATH variable with this command

export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"

On CentOS possible default full paths are:

/usr/bin/ec2metadata - from package: cloud-utils

You may install the required package with command yum install {package}

On Debian possible default full paths are:

/usr/bin/ec2metadata - from package: cloud-utils

You may install the required package with command apt-get install {package}
Error in other languages:
ec2metadata: bevel nie gevind nie
ec2metadata: comandă negăsită
ec2metadata: comando não encontrado
ec2metadata: commande introuvable
ec2metadata: command not found
ec2metadata: käsku ei ole
ec2metadata: không tìm thấy lệnh
ec2metadata: komanda nerasta
ec2metadata: Kommando nicht gefunden.
ec2metadata: kommandot finns inte
ec2metadata: komut yok
ec2metadata: nie znaleziono polecenia
ec2metadata: níor aimsíodh an t-ordú
ec2metadata: no se encontró la orden
ec2metadata: no s'ha trobat l'ordre
ec2metadata: opdracht niet gevonden
ec2metadata: parancs nem található
ec2metadata: perintah tidak ditemukan
ec2metadata: príkaz nenájdený
ec2metadata: příkaz nenalezen
ec2metadata: команда не найдена
ec2metadata: командата не е открита
ec2metadata: 命令找不到
ec2metadata: コマンドが見つかりません