This is 5.18 from Axler's Linear Algebra Done Right:
Theorem: Suppose $T \in L(V)$ has an upper-triangular matrix with respect to some basis of $V$. Then the eigenvalues of $T$ consist precisely of the entries on the diagonal of that upper-triangular matrix.
Suppose $(v_1, \ldots , v_n)$ is a basis of $V$ with respect to which $T$ has an upper-triangular matrix where the diagonal entries are $\lambda_1, \ldots, \lambda_n$.
Let $\lambda \in F$
Then for matrix $M(T - \lambda I$) where the diagonal entries are $\lambda_1 - \lambda, \ldots \lambda_n - \lambda.$ We can suppose we are dealing with complex vector spaces. From 5.16 where have proven that $T$ is not invertible iff one of the $\lambda_k$'s equals $0$. Hence $T - λI$ is not invertible if and only if $λ$ equals one of the $λj$'s. In other words, $λ$ is an eigenvalue of $T$ if and only if $λ$ equals one of the $λj$s, as desired.
This only showed that one of the diagonal entries is en eigenvalue but not all of them as the theorem claimed.