On Linux at least, getent [passwd|group] sensu should be used instead of grepping /etc/passwd and /etc/group. If your sensu user is in LDAP (freeipa specifically in my scenario), and not in the flat files, the RPM will still create the user causing the flatfiles to take precedence. If the UID/GID are different, things now break. I cannot speak to the other supported systems, but I would be surprised if they did not also contain a mechanism to search for users that is more robust than grepping.
On Linux at least,
getent [passwd|group] sensu
should be used instead of grepping /etc/passwd and /etc/group. If your sensu user is in LDAP (freeipa specifically in my scenario), and not in the flat files, the RPM will still create the user causing the flatfiles to take precedence. If the UID/GID are different, things now break. I cannot speak to the other supported systems, but I would be surprised if they did not also contain a mechanism to search for users that is more robust than grepping.