Hewlett-Packard has agreed to buy security software maker ArcSightfor $1.5 billion in cash, as the computer giant tries to expand the range of services it offers corporate clients. ArcSight’s software is used by companies and governments to track and identify suspicious activity on corporate networks.