Let $K$ be a field, $X$ an indeterminate, and $V$ a finite dimensional $K[X]$-module.
Recall that the multiset of elementary divisors of $V$ is the multiset $f_1^{n(1,1)},\dots,f_1^{n(1,k(1))},$ $\vdots$ $f_r^{n(r,1)},\dots,f_r^{n(r,k(r))},$ defined by the following conditions: the $f_i$ are distinct monic irreducible polynomials, the $n(i,j)$ satisfy $n(i,1)\ge\cdots\ge n(i,k(i)),$ and we have $V\simeq\bigoplus_{i,j}\frac{K[X]}{\big(f_i^{n(i,j)}\big)}\quad.$
The characteristic polynomial is the product of the elementary divisors, whereas the minimal polynomial is the product of the $f_i^{n(i,1)}$.
If $W$ is also a finite dimensional $K[X]$-module, then the multiset of elementary divisors of $V\oplus W$ is the "disjoint union" (in the obvious sense) of the multisets of elementary divisors of $V$ and $W$.
Some diagonal entries of Nir's matrix are equal to 1, and the others are $X,\quad X+2,\quad X^2,\quad X+2,\quad (X+2i)(X-2i)X,\quad (X+2)^2.$ The multiset of elementary divisors is thus $\begin{matrix} (X+2)^2,&X+2,&X+2,\\ \\ X^2,&X,&X,\\ \\ X+2i,&&\\ \\ X-2i.&& \end{matrix}$ The characteristic polynomial is $(X+2)^4X^4(X+2i)(X-2i).$ The minimal polynomial is $(X+2)^2X^2(X+2i)(X-2i).$ The Jordan blocks $J(\lambda,n)$ are $\begin{matrix} J(-2,2),&J(-2,1),&J(-2,1),\\ \\ J(0,2),&J(0,1),&J(0,1),\\ \\ J(-2i,1),&&\\ \\ J(2i,1).&& \end{matrix}$
Let's compute the invariant factors (even if it wasn't required). In the array of elementary divisors, there are four blank entries. We put a $1$ in each of them: $\begin{matrix} (X+2)^2,&X+2,&X+2,\\ \\ X^2,&X,&X,\\ \\ X+2i,&1,&1,\\ \\ X-2i,&1,&1. \end{matrix}$ We get the first invariant factor by multiplying together the polynomials in the first row, and so on. Thus the invariant factors are $(X+2)^2X^2(X+2i)(X-2i),\quad (X+2)X,\quad (X+2)X.$
[Reference: Bourbaki, Algèbre, VII.4.8.]