In this paper, the entanglement in a spin-1 Heisenberg <i>XXZ</i> chain with uniform and nonuniform external
magnetic field is investigated in the terms of the measure of entanglement called 'negativity'. The effects of
the external magnetic field, the anisotropy parameter and the temperature on the negativity are discussed
respectively. It can be seen that the entanglement in this spin chain for any temperature is symmetric with
respect to zero magnetic field. We calculate the partially transposed density matrix and give qualitatively results
at different temperatures. In order to show the results clearly, the behavior of negativity is presented for five
different cases. It can be found that the temperature and the external magnetic field can effect the feature of the
thermal entanglement significantly. In addition, under certain condition, the negativity may be enhanced under a nonuniform magnetic field.